-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[6.1] Expand useGlobal to also use plugin parameters #46439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6.1-dev
Are you sure you want to change the base?
Conversation
|
Nice one. For consistency, I would also support the component name and then deprecate the true attribute for useglobal. Like that we can get rid of the global input parameter. |
|
Hi @laoneo Thanks, glad you like it. Already have this in place for my plugins via overrides: works like a charm :) I will make a change so you can use component name or plugin name, with a fallback of 'true' to the component name from the input parameter. If this is something that would get integrated i can also do the other fields that now have 'useglobal' support. |
|
Sure. We can also get this RTC and then expand from there. |
|
You can now use component name e.g. 'com_content', plugin name or 'true' as B/C fallback |
|
Cool, I would replace one occurrence in core for plugins and one for a component. Like that it can be tested relatively easy. |
|
For core a replacement can be made, but not for plugins as that is a new feature and not used in core. As a side note: why is the CI Joomla Check PHP code style failing on the use of a '' on e.g. \str_starts_with, but it is allowing it on \is_null? |
Pull Request for Issue # -.
Summary of Changes
In form xml files you can add useglobal="true", this will then extend the field to show the value for the field in the matching component options.
This PR extends the useglobal to not only use the component options but also a plugins options.
This will create the possibility to have the same functionality it had but then for (global) plugin parameters.
This is a POC on the 'text' field to see if there is interest in this change, if so I can further extend it to the other fields that have the useglobal functionality:
Testing Instructions
on a formfield you can now have the following useglobal settings:
Actual result BEFORE applying this Pull Request
The text field would show empty
Expected result AFTER applying this Pull Request
The textfield will show 'Use Global (abc)' where abc is the value of the field in the plugin configuration
Link to documentations
Please select:
Documentation link for docs.joomla.org: https://manual.joomla.org/docs/general-concepts/forms-fields/standard-fields/text/
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed