NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
25 Dec 2020

Pull Request for Issue # . Part of the Child template effort

Summary of Changes

  • Move all the scss files to /media/system/scss
  • Adjust all the stylesheet includes

Testing Instructions

Screenshot 2020-12-25 at 13 06 00
Screenshot 2020-12-25 at 13 09 49

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

It works exactly as before, the static assets were just moved into the /media folder

Documentation Changes Required

IDK the system templates are supposed to act as fallback if something goes horrible wrong with the current active template (but the fallback is not pretty or functional...)

avatar dgrammatiko dgrammatiko - open - 25 Dec 2020
avatar dgrammatiko dgrammatiko - change - 25 Dec 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Dec 2020
Category Administration Templates (admin) NPM Change Repository Front End Templates (site) JavaScript
avatar dgrammatiko dgrammatiko - change - 25 Dec 2020
Labels Added: NPM Resource Changed ?
avatar brianteeman
brianteeman - comment - 25 Dec 2020

You are deleting administrator/templates/system/images/calendar.png but it is still referenced here i think

background: url("../images/calendar.png") no-repeat;

avatar dgrammatiko
dgrammatiko - comment - 25 Dec 2020

You are deleting administrator/templates/system/images/calendar.png but it is still referenced here

Yes the reference is fine because in the media/system/images the file already exists. So this pr just removed the duplicate...

avatar brianteeman
brianteeman - comment - 25 Dec 2020

Yes the reference is fine because in the media/system/images the file already exists. So this pr just removed the duplicate...

Isn't the path wrong then?

avatar dgrammatiko
dgrammatiko - comment - 25 Dec 2020

Isn't the path wrong then?

The scss will compile this to url("../images/calendar.png") which is relative to /media/system/css/general.css (the 2 dots dictate to go one level up and then use the images/calendar.png), so I'm pretty sure this is fine

EDIT: btw this is totally FOOBAR. The calendar is not using png images for the icon in J4, in J3 there was an instance in the Beez and the Hathor templates

avatar brianteeman
brianteeman - comment - 26 Dec 2020

Can you please confirm the line numbers and changes for the test instructions

avatar dgrammatiko dgrammatiko - change - 26 Dec 2020
The description was changed
avatar dgrammatiko dgrammatiko - edited - 26 Dec 2020
avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

@brianteeman oops there was an error in the instructions

avatar dgrammatiko dgrammatiko - change - 26 Dec 2020
The description was changed
avatar dgrammatiko dgrammatiko - edited - 26 Dec 2020
avatar dgrammatiko dgrammatiko - change - 26 Dec 2020
The description was changed
avatar dgrammatiko dgrammatiko - edited - 26 Dec 2020
avatar brianteeman
brianteeman - comment - 26 Dec 2020

I dont seem to be able to trigger the use of the system template

avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

@brianteeman maybe it's easier to comment out the whole public function getTemplate in both the Site and Administrator apps so the system kicks in (it's the default on the Web app?

avatar brianteeman
brianteeman - comment - 26 Dec 2020

So the problem was that I was editing one site and viewing another ?

It appears to work BUT in your screenshots there is a data-asset-name which i dont get, is that from an earlier version?

image

avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

It appears to work BUT in your screenshots there is a data-asset-name which i don't get

That's just the extra bits added whenever the debug is enabled. It's fine if you don't have them

avatar brianteeman
brianteeman - comment - 26 Dec 2020

I have tested this item successfully on 9a467db

got there in the end


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31781.

avatar brianteeman brianteeman - test_item - 26 Dec 2020 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

@brianteeman thanks for testing, appreciated and Merry Xmas

avatar brianteeman
brianteeman - comment - 26 Dec 2020

I have not tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31781.

avatar brianteeman brianteeman - test_item - 26 Dec 2020 - Not tested
avatar brianteeman
brianteeman - comment - 26 Dec 2020

Sorry I had to remove my successful test.

The PR moves the css to the media folder BUT tinymce still refers to the /templates/ folder when it is looking for an editor.css otherwise it gives an error everytime you open an editor.

			if ($use_content_css)
			{
				// First check templates folder for default template
				// if no editor.css file in templates folder, check system template folder
				if (!file_exists($templates_path . '/' . $template . '/css/editor.css'))
				{
					// If no editor.css file in system folder, show alert
					if (!file_exists($templates_path . '/system/css/editor.css'))
					{
						Log::add(Text::_('PLG_TINY_ERR_EDITORCSSFILENOTPRESENT'), Log::WARNING, 'jerror');
					}
					else
					{
						$content_css = Uri::root(true) . '/templates/system/css/editor.css';
					}
				}
				else
				{
					$content_css = Uri::root(true) . '/templates/' . $template . '/css/editor.css';
				}
			}
		}
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/31781">issues.joomla.org/tracker/joomla-cms/31781</a>.</sub>
avatar joomla-cms-bot joomla-cms-bot - change - 26 Dec 2020
Category Administration Templates (admin) NPM Change Repository Front End Templates (site) JavaScript Administration Templates (admin) NPM Change Repository Front End Plugins Templates (site) JavaScript
avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

@brianteeman good catch! 6541859 should fix that

avatar brianteeman
brianteeman - comment - 26 Dec 2020

The last patch solved the error message but I'm not sure if the editor.css is being used. And shouldnt it be the minified file?

avatar dgrammatiko
dgrammatiko - comment - 26 Dec 2020

And shouldnt it be the minified file?

Joomla just hands in the url for the css to tinyMCE which is doing all the work here (it's in an iframe so it needs a bit more digging to get to it). Could it be minified? Sure but since we're doing all the checks ourselves (in the tinyMCE plugin, the PHP part) we have to do that ourselves. The part that I reverted was using HTMLHelper::stylesheet which does all the work in the background for us but it was wrong as it needs to refer to the active front end template (by default it refers to the current active template which will be wrong for the backend part)

avatar dgrammatiko
dgrammatiko - comment - 12 Mar 2021

I will redo this PR with a twist, we can do better here

avatar dgrammatiko dgrammatiko - change - 12 Mar 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-03-12 15:09:53
Closed_By dgrammatiko
avatar dgrammatiko dgrammatiko - close - 12 Mar 2021

Add a Comment

Login with GitHub to post a comment