? ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
12 Dec 2022

Pull Request for Issue #39399 .

Summary of Changes

Allow templates with <inheritable>0</inheritable> to use the media folder

Testing Instructions

  • Fork Cassiopeia
  • Change its XML file to have 0
  • Install the resulting template

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

And an answer to Nic:

Side note: this is exactly why I've been telling Dimitris to think beyond a singular use case. I am being pragmatic.

Right, you assume that templates should have an option to opt out of child templates. Cool, why tho? The inheritability of the templates is a build in functionality, similar to the Class inheritability of PHP. If some template authors find it too restrictive or bad or whatever they can extend it to fit their own flavours. Just a reminder that child templates were introduced to offer a way for user's tweaked files to persist an update.

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.

So, because I said that the dark theme approach that you took was wrong (I didn't say bad) you took that as a toxic comment but quite honestly George also pointed that your approach was completely opposite to the Bootstrap. I think I understand Joomla and the complexities that come with it enough, eg I'm the one that almost solely updates Bootstrap to a new version after V5 so you might as well say that I might have a clear picture of what some SCSS code would add to the maintenance burden.

Instead of listening to reasonable arguments he responds with ad hominem attacks that the project tolerates.

Sorry but what was the fallacy?

As a result I am leaving and he stays.

For one I didn't ask you to leave, (that was your decision because you didn't liked a comment?), but you know what? It might be easier if you stay and I leave instead. Happy? BTW I find all these extremely childish...

avatar dgrammatiko dgrammatiko - open - 12 Dec 2022
avatar dgrammatiko dgrammatiko - change - 12 Dec 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Dec 2022
Category Libraries
avatar dgrammatiko dgrammatiko - change - 12 Dec 2022
Labels Added: ?
avatar nikosdion
nikosdion - comment - 12 Dec 2022

I did not say that inheritable templates is a bad idea. I think it's a good idea. I am using a child template of Cassiopeia on my own blog site, for crying out loud!

I did not say that moving the static resources of templates under media is a bad idea. I was very clear that it's a VERY GOOD idea from a security perspective. One that I have been nagging about since 2009 ?

I really do think that inheritable templates AND moving static resources to media was a very valuable contribution. I am not going to deny two positive changes on silly interpersonal relationship grounds. Please. Y'all know me better than this.

I DID however say that not all templates should need to be marked as inheritable. Thank you for likening them to PHP classes. Let me remind you of the final keyword in PHP which makes a class non-inheritable and a method non-overridable. That's exactly my expectation from this feature, in PHP and Joomla alike. I do not expect my programming language to give me a choice between using final on one hand and having private and protected members on the other hand, but never both at the same time. Why should I expect my CMS to force such an unnecessary, impossible choice upon me?

You asked why someone would essentially want to make their template final (non-inheritable). I will give you three use cases off the top of my head and based on discussions I've had with site integrators, template developers, and my personal experience.

As a site integrator I don't want to mark my template inheritable if I am not going to put the work to actually make it inheritable. Another maintainer of the site will try to create a child template for a “mini-site” (pages which have a different menu than the home menu as their root, typically created for a marketing campaign). This will fail. The best way to communicate “this template can't really do that” is by setting its inheritable property to 0, not putting it in some internal documentation the other person might not read and waste their time as a result.

Many templates built on various 3PD template frameworks (like Gantry) are unlikely to be particularly conducive to being inheritable unless a lot of work is put into them and/or the 3PD framework supports that feature. If I'm selling templates based on such a framework I don't want my clients to try and make child templates only to report that child templates don't work. Again, the way to communicate that is setting inheritable to 0.

Finally, my personal use case from this morning. I have created a template based on Bootstrap 5 that's got nothing in common with Cassiopeia. It's a standalone template, not a child template. I want to insulate its PHP code from the world through .htaccess rules. This requires moving its static resources to media. Currently, this requires setting inheritable to 1. No problem, right?! Well, actually… My existing site template style is from the 4.0-beta4 times which didn't have inheritable templates and it's marked as non-inheritable. When I install the new template, marked inheritable, it does not update the style (and correctly so). Unfortunately, this means that my site will be broken as soon as I install the new version of my template. I will have to take my site offline, install the new template, create a new template style, make it the default, set the site online, remove the old style. Or I have to write a shell script which installs the template using Joomla CLI and runs a short MySQL script to update my template style's inheritable parameter. Sure, I can do that, but I am a far cry from being the average user, or even a power user. I have literally built major parts of Joomla and my work on the FOF framework has either been copied into Joomla or informed the design of Joomla 4. Are you sure that either of these course of action are obvious to, or even considered reasonable by, the average site integrator? I have my doubts.

As I have told people so many times, this is mass distributed software with a multitude of use cases. NONE of us —myself included— can possibly know of ALL the use cases. We only do our job right as developers if we write our code in a way which does not impose arbitrary, unnecessary prerequisites and does not spectacularly fail if the user's use case deviates from the small subset of cases we have considered — or, if it does, at least provide a thread an intermediate user will pull to start unraveling the failure conditions. Debugging this was possible for me, but required using XDebug to step through the code. That's well beyond the skillset of even an experienced site integrator. Do not put roadblocks in the path of users; they will go somewhere else where there's less friction.

As to why I decided to stop contributing code, it's this thing here. Sigh. My words were twisted, assumptions about my intentions were made, and there's this subtext in the phrasing that what I reported is nonsensical as you're only begrudgingly addressing it. This keeps happening — and I'm not the only one it keeps happening too, it's been happening for years to hundreds of users and former contributors.

To be crystal clear, I have no problem whatsoever having my ideas and my code challenged with reasonable arguments, through productive dialogue. I don't care about silly Internet brownie points (commit stats, credits, whatever have you). I care about RESULTS. I care about this godforsaken CMS working consistently and in a way that appeals to its actual target audience, not just the twenty or so of us who know it like the back of our hands. I will just leave one very recent example where I spent an entire day to write some code and I gracefully decided to disown it in favour of a better solution by someone else: #38926

I am a Mechanical Engineer and a software developer. I make decisions based on reason and facts. I am not a crazy person. Being portrayed as one by twisting my words and filling in the gaps in your reasoning with speculation and baseless accusations is shocking, disheartening, maddening, outright toxic, and breaks down productive dialogue in this community (you didn't like it when I did the same to you, Dimitris, did you?). Life is too short to spend it in toxic engagement. It sucks my time, it demotivates me, it hurts me, and doesn't help me grow as a person. That's why I am leaving. To heal away from this constant negativity and toxicity. I hope this community improves so I can resume contributing some day.

avatar brianteeman
brianteeman - comment - 12 Dec 2022

Please can someone update the title to a meaninggul one

avatar fancyFranci fancyFranci - change - 17 Jan 2023
Title
Fix for #39399
Templates with inheritable can use media folder
avatar fancyFranci fancyFranci - edited - 17 Jan 2023
avatar dgrammatiko dgrammatiko - change - 6 Mar 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-03-06 18:15:10
Closed_By dgrammatiko
Labels Added: ?
avatar dgrammatiko dgrammatiko - close - 6 Mar 2023

Add a Comment

Login with GitHub to post a comment