Theme navigation duplicated after "composer upgrade"

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Theme navigation duplicated after "composer upgrade"

Post by kdim95 » 19 Oct 2022, 08:31

Laravel framework version: 9.36.2
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux

The main menu appears to be duplicated after executing the "composer upgrade" command.

Before the issue appeared, I've been changing around some theme settings.
I was attempting to create a theme with a new name in my extension.
I copied the default theme with a different directory name and then added the config client/themes/mytheme/MyTheme, so the theme appears in the dropdown, switching to that theme caused the main menu to disappear, I also attempted to switch the "Shop domain" setting to "mytheme", then there was an error and I had to switch it back to "default".
I also attempted commands to clear the cache after adding the theme, "composer upgrade", "php artisan cache:clear", "php artisan view:clear".

I have a backup of the old public/vendor/shop/themes/default.
When I replace the files in that directory with the ones from the backup, the issue is fixed.
But every time I execute "composer upgrade", the issue returns.
It appears that there is a mismatch with the version of ai-client-html the package, because my backed up theme files have slight differences, for example the "aimeos.css" and "aimeos.js" files.
This leads me to believe that the "ai-client-html" package was somehow upgraded and is not working well with the rest.
It seems to be overwriting my theme files when I execute "composer upgrade".
What should I do to fix this? The main issue seems to be the duplication of the menu items.

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: Theme navigation duplicated after "composer upgrade"

Post by kdim95 » 19 Oct 2022, 23:35

I fixed it by overwriting vendor/aimeos/ai-client-html with the one from my backup, I don't understand what went wrong here, but the issue seems to be fixed now.

User avatar
aimeos
Administrator
Posts: 7915
Joined: 01 Jan 1970, 00:00

Re: Theme navigation duplicated after "composer upgrade"

Post by aimeos » 20 Oct 2022, 06:58

Don't change any files in the ./vendor/ directory because they will be overwritten each time a new version is installed using " composer update"!

Instead, create a Laravel theme extension and adapt the files there:
https://aimeos.org/extensions
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: Theme navigation duplicated after "composer upgrade"

Post by kdim95 » 20 Oct 2022, 08:12

I think I wasn't changing the files in the ./vendor directory, but they somehow updated.
I could have touched a few lines and reverted the changes in the package, but that was just to make sure I was overriding the correct files in my extension. Could that have caused the package to update somehow?

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: Theme navigation duplicated after "composer upgrade"

Post by kdim95 » 20 Oct 2022, 11:23

I have created a theme extension, but the issue persists when I switch to the new theme.

Steps to reproduce:
1) Create a mytheme Laravel theme 2022.x extension here:
https://aimeos.org/extensions
2) Upload the theme to packages/mytheme
3) Execute composer update
4) Switch to the new theme from the settings

If not switched to the new theme, there are no errors.

I attached an image showing what it looks like
broken-menu.PNG
broken-menu.PNG (89.77 KiB) Viewed 1082 times

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: Theme navigation duplicated after "composer upgrade"

Post by kdim95 » 23 Oct 2022, 20:08

Bumping because the menu issue persists, not sure what's causing it.

User avatar
aimeos
Administrator
Posts: 7915
Joined: 01 Jan 1970, 00:00

Re: Theme navigation duplicated after "composer upgrade"

Post by aimeos » 24 Oct 2022, 16:18

Tested locally but unable to reproduce.
According to your screenshot (browser inspector), there's also no HTML node twice.
There's only something in the background which looks like a shadow of the navigation.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply