No Code Attached Yet bug
avatar Tazzios
Tazzios
23 Mar 2024

Is your feature request related to a problem? Please describe.

In Joomla 3 and 4 it was possible to return an array of buttons with one plugin. In joomla 5 only the last button is shown. Om not sure or this is on purpose or not so I made a feature request instead of a bug, and Im probably the only one who runs into this issue. :)

Describe the solution you'd like

Support to return an array of buttons (and also show them) instead of only one (latest) button.

Additional context

I have made a plugin which user can use to create own buttons, but in J5 it does only show the latest button of the array.
https://github.com/Tazzios/Universal-buttons/

avatar Tazzios Tazzios - open - 23 Mar 2024
avatar joomla-cms-bot joomla-cms-bot - change - 23 Mar 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Mar 2024
avatar Tazzios Tazzios - change - 23 Mar 2024
The description was changed
avatar Tazzios Tazzios - edited - 23 Mar 2024
avatar Tazzios Tazzios - change - 23 Mar 2024
The description was changed
avatar Tazzios Tazzios - edited - 23 Mar 2024
avatar brianteeman
brianteeman - comment - 23 Mar 2024

see also #40472

avatar Fedik
Fedik - comment - 23 Mar 2024

In Joomla 5, also should work.
Hovewer there a new API, I suggest to update old code.
Please follow https://manual.joomla.org/docs/building-extensions/plugins/editors-xtd-plugin

For old buttons, I think there a bug in resolving legacy buttons, when there an array

foreach ($legacyButton as $item) {
// Extract button properties
if ($item instanceof CMSObject) {
$props = $item->getProperties();
} elseif ($item instanceof Registry) {
$props = $item->toArray();
} else {
continue;
}
$options = !empty($props['options']) ? $props['options'] : [];
// Some very old buttons use string for options, but this does not work since Joomla 3, so we reset it here
$options = \is_array($options) ? $options : [];
unset($props['options']);
$button = new Button($plugin->name, $props, $options);
$this->add($button);

Need to check

avatar Fedik Fedik - change - 23 Mar 2024
Labels Added: bug
avatar Fedik Fedik - labeled - 23 Mar 2024
avatar Fedik Fedik - close - 23 Mar 2024
avatar Fedik
Fedik - comment - 23 Mar 2024

Please test #43129

avatar Fedik Fedik - change - 23 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-23 15:18:32
Closed_By Fedik
avatar Tazzios
Tazzios - comment - 23 Mar 2024

@Fedik That is fast! Tested your solution and it works.
Will look at the Joomla 5 documentation.

avatar Fedik
Fedik - comment - 23 Mar 2024

Please visit https://issues.joomla.org/tracker/joomla-cms/43129
and click this litle button
Screenshot 2024-03-23_18-39-41

to set your test result

Add a Comment

Login with GitHub to post a comment