Merge Script Options recursive#19972
Conversation
|
@bembelimen I like it and I don't see any problems changing the behaviour. Edge case if someone used this code to actually replace the values in the storage but then again I don't think that many people are actually using or even understand the |
|
Thank you for your feedback @DGT41 if someone wants to replace, he could set the $merge parameter to "false" |
|
I have tested this item ✅ successfully on d8b3c51 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19972. |
|
looks fine
that was intent 😉 if it works, then can be as @bembelimen suggested also 😉 |
|
I have tested this item ✅ successfully on d8b3c51 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19972. |
|
Ready to Commit after two successful tests. |
Summary of Changes
With the JDocument::addScriptOptions method it's possible to change script parameters like the TinyMCE plugin parameters from outside (like with a plugin). This functionality was implemented with the following PR: #3072 and in the TinyMCE here: #11157 (with examples)
The problem at the moment is, that the "new parameters" will only be merged on the first level, so for example for the TinyMCE you cannot change parameters of deeper level in an easy way.
Testing Instructions
Add the following code into your template index file:
Expected result
Actual result
More description
This example is very small, but e.g. the tinyMCE has somewhere about 50 parameters with a level of 3 or more. If you want to change one parameter in the depth, you have to rebuild the whole tree (or load the current tree, setup the variables and then set again), which makes the "merge" a bit useless.
Perhaps @Fedik and @DGT41 could look over this functionality, because they worked with it.