Hallo zusammen,
ich hatte den gleichen Fehler bei Shopware 5. Jedoch bei den Varianten. Sollte jemand den gleichen Fehler haben, ist hier die Lösung:
-
Fehlerhafte Klasse ermitteln. z.B.: “Shopware\Models\Attribute\ConfiguratorOption”
-
Datenbank Tabelle zur Klasse ermitteln: z:B: s_article_configurator_options_attributes_new
-
Folgendes Script an die DB anpassen (Klassennamen und Spalten):
– add foreign key for s_article_configurator_options prefix
DROP TABLE IF EXISTS s_article_configurator_options_attributes_new;
DROP TABLE IF EXISTS s_article_configurator_options_attributes_backup;– Copy structure and data to new table, this does not copy the foreign keys, that’s exactly what we want
CREATE TABLE s_article_configurator_options_attributes_new LIKE s_article_configurator_options_attributes;
INSERT INTO s_article_configurator_options_attributes_new SELECT * FROM s_article_configurator_options_attributes;RENAME TABLE s_article_configurator_options_attributes TO s_article_configurator_options_attributes_backup, s_article_configurator_options_attributes_new TO s_article_configurator_options_attributes;
– Add missing foreign key
ALTER TABLEs_article_configurator_options_attributes
ADD FOREIGN KEY (optionID
) REFERENCESs_article_configurator_options
(
id
) ON DELETE CASCADE ON UPDATE NO ACTION ;DROP TABLE s_article_configurator_options_attributes_backup;
-
Script auf der DB ausführen
-
Cache über SSH leeren var/cache/clear_cache.sh
-
Cache über das Shopware Backend löschen
-
Fertig