In Joomla 4 you have the ability to delete files in the Template Manager
If you attempt to delete your frontend templates index.php file you are prevented from doing so
If you attempt to delete your frontend templates joomla.asset.json
file you are NOT prevented from doing so
If you delete joomla.asset.json
then you whole site will crash.
joomla.asset.json
to be a protected file like index.php is and cannot be deleted using the web interface template manager.
delete joomla.asset.json
and your site is now crashed with a generic 500 error message
same happens if you make a typo in this file.
Labels |
Added:
?
|
Yes, like I said: :-)
same happens if you make a typo in this file.
this is third reason ;)
In general the file:
https://developer.joomla.org/schemas/json-schema/web_assets.json
But note: If the template defines all assets in its index.php (component.php etc) then file can be removed.
We could/should probably at least validate the JSON in the file
Labels |
Added:
J4 Issue
|
joomla.asset.json to be a protected file like index.php is and cannot be deleted using the web interface template manager.
So this one (I've just tested) is a bit more tricky. It fails because none of the assets cassiopeia uses in joomla.asset.json are being found (for obvious reasons).
However in a 3rd party template obviously this doesn't have to be the case. We even have the assetExists
method which we use in some of our components for this.
I guess the reality though is probably if a component ships this file then it shouldn't be deleted however... We just need to be careful to ensure that we don't require templates to ship with one.
I guess the reality though is probably if a component ships this file then it shouldn't be deleted however
I agree, same for template, if template ships this file then it shouldn't be deleted.
We just need to be careful to ensure that we don't require templates to ship with one.
In documentation we already have a note:
Note: Having joomla.asset.json for your extension or template are recommend but not required to WebAssset to work (see next section).
Maybe can elaborate that note, somehow.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-18 16:32:07 |
Closed_By | ⇒ | wilsonge |
It not the file is required, but the content in it.
Empty file or removed an asset definition in the file may lead to crash as well