No Code Attached Yet
avatar nikosdion
nikosdion
12 Dec 2022

Steps to reproduce the issue

  • Fork Cassiopeia
  • Change its XML file to have <inheritable>0</inheritable>
  • Install the resulting template

Expected result

The template works

Actual result

The template DOES NOT work. No CSS or JS is loaded from the media/templates/site/mytemplate subfolders.

System information (as much as possible)

Irrelevant.

Additional comments

The problem is very obvious:

if ($template->inheritable || !empty($template->parent)) {
$client = $app->isClient('administrator') === true ? 'administrator' : 'site';
$templaPath = JPATH_ROOT . "/media/templates/$client";
}

Since Joomla will eventually (and very correctly!) forbid template resources from being loaded from the templates and administrator/templates subdirectories for obvious security issues in Joomla 6 or thereabouts, Joomla is essentially forcing template developers and site integrators to mark all templates as inheritable or they will stop working in the future.

All bespoke templates and the majority (if not all of) templates which are based on a third party template framework have valid reasons to NOT be inheritable. Joomla MUST NOT make that impossible.

This is very easy to solve, following a pattern used in Joomla since it was called Mambo. Use TWO $templaPaths (sic), i.e. make it an array. Wrap lines 402 to 542 in a foreach (ideally this needs to be heavily refactored but, hey, baby steps — make it work before you make the code look pretty). The one in the media folder should take precedence, the old one under JPATH_THEMES should be a fallback. In Joomla 6 you can remove the legacy path.

Side note: this is exactly why I've been telling Dimitris to think beyond a singular use case. I am being pragmatic. His response is to attack my professionalism without impunity which is incredibly toxic. If we want to go this route, sure. Dimitris is unprofessional. Not only he doesn't understand that Joomla caters to more than one use case, he doesn't want to understand this critical fact. Instead of listening to reasonable arguments he responds with ad hominem attacks that the project tolerates. As a result I am leaving and he stays. This is the kind of blatantly obvious issues you'll be getting by having an arrogant and toxic developer force his way being accepted while driving away contributors who could act as a balance to his behaviour. You reap what you sow.

avatar nikosdion nikosdion - open - 12 Dec 2022
avatar joomla-cms-bot joomla-cms-bot - change - 12 Dec 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Dec 2022
avatar richard67 richard67 - change - 12 Dec 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-12-12 16:08:42
Closed_By richard67
avatar richard67 richard67 - close - 12 Dec 2022
avatar richard67
richard67 - comment - 12 Dec 2022

Closing as having a pull request. Please test #39402 . Thanks in advance.

Add a Comment

Login with GitHub to post a comment