Shopware: Plugin install on CLI works, but admin removes it again!?
Fabian Blechschmidt
Today I had a weird behaviour of one of our customers store. We tried to install the Shopware Security Plugin and what happened was:
- I install the security plugin via composer
- I refresh the plugins via CLI -> plugin is in CLI and database
- I activate and install the plugin -> plugin is installed in CLI and database
- I update the plugin list on the admin area -> the plugin is deleted from database and gone in CLI
TL;DR: Opcache.
I turned to Shopware’s slack and asked the community. We had this behaviour in the past, but I couldn’t remember what the problem was.
Thankfully I got an answer <3
I think I had this problem once as well. Have you cleared OpCache? If I remember correctly, that did the trick for me
Johannes Przymusinski [die-lobby.de]
Thanks Johannes!
Reset opcache
I know two ways to reset opcache:
- Restart PHP-fpm
- or using the awesome cachetool by gordalina!
Other articles from this category
Shopware 6 Hidden Gems #16: CloneBehavior — entity duplication with overrides, one call
You know the admin’s „duplicate“ button on products. Now the ticket says: „We need that, but from code — duplicate a product per sales channel, with adjusted name and its own product number.“ Or: „Campaign landing pages: clone this CMS page 20 times with different headlines.“ I’ve watched this get implemented as: load entity with […]
Shopware 6 Hidden Gems #15: ChangeSet — before/after values for every write, no second query
The requirement sounds harmless every time: „Log when a product price changes, with old and new value.“ Or: „When an order’s email changes, notify the old address.“ Or the audit-trail classic: „Who changed what, from what, to what?“ And every time, the naive implementation is the same sad shape: subscribe to product.written, load the entity […]
Shopware 6 Hidden Gems #14: WriteProtected & ApiAware — field-level security without a single subscriber
A code review scenario. A plugin adds a purchasePrice-style field to a custom entity — internal margin data. The review question: „Can the Store API read this?“ Followed by: „Can the Admin API write that computed field you recalculate in a subscriber?“ The answers, in the plugin at hand, were „yes“ and „yes, and then […]