backdrop-contrib / gin

Admin theme with a strong focus on improving the Editorial Experience.
https://backdropcms.org/project/gin
GNU General Public License v2.0
5 stars 2 forks source link

Nivo slider with GIN admin theme- cannot add or remove slides #89

Closed muranod closed 9 months ago

muranod commented 9 months ago

I wanted to add new slides to one of my Nivo sliders. With Seven admin theme, there is an option to edit the slider right next to where it is displayed, but this doesn't show with Gin admin theme.

I went through the menu to edit the slides, but when I click the Edit Slider option (on multiple sliders), I get a php error:

Error: Unsupported operand types in gin_menu_local_action() (line 79 of /home/myfolder/public_html/mysitename.com/themes/gin/template.php).

I had to switch back to Seven to add slides.

PHP version: Version: 7.4.33 Backdrop: 1.26.3 MySQL, MariaDB, or equivalent version 10.5.23-MariaDB jQuery version 1.12.4 / jQuery UI version 1.13.2

Attaching files - Note that there are two menu items - both Edit Slides and Edit Options (for Nivo Slider under Admin>Structure>Nivo Sliders . The Edit Options link works under Gin, the Edit Slides option does not.

It's not a major issue for me because I don't change sliders that often and can easily switch to Seven to do that. Admins for other sites may use the edit slides option more frequently though.

Gin_vs_7-theme_n_Nivo.zip

laryn commented 9 months ago

Thanks for the report. I don’t use Nivo — can you post screenshot comparisons between Seven and Gin, if appropriate/helpful for when I get a chance to look?

muranod commented 9 months ago

Added them to my original post. Thanks.

laryn commented 9 months ago

@muranod Are you comfortable testing something for me? On the line in question (line 79 of /home/myfolder/public_html/mysitename.com/themes/gin/template.php), can you change it from this:

$link['localized_options']['attributes']['class'][] += $classes;

to this:

$link['localized_options']['attributes']['class'] += $classes;

That's just removing the [] -- and let me know if that solves it? If you aren't able to, no problem, I'll try to get this set up and tested at some point soon.

docwilmot commented 9 months ago

I'd done a big UI change and some fixes for Nivo but never got around to pushing a full release. Will probably do that soon.

muranod commented 9 months ago

Excellent. I'm having no issues on the front end - just the error messages that show up in the logs. I'm happy with how it works and enhances my site. Thanks!

muranod commented 9 months ago

@muranod Are you comfortable testing something for me? On the line in question (line 79 of /home/myfolder/public_html/mysitename.com/themes/gin/template.php), can you change it from this:

$link['localized_options']['attributes']['class'][] += $classes;

to this:

$link['localized_options']['attributes']['class'] += $classes; ....................

@docwilmot Yes, It works after making that change.

laryn commented 9 months ago

Thank you @muranod -- this fix will be included in the next release.