cp-nav: Constraint violation
Description
After updating to the lastest Craft version (3.4.4) cp-nav seems to only work locally. Whenever I deploy to my staging environment project.yaml throws a conflict.
Steps to reproduce
- Update Craft CMS to latest version (3.4.4) and install CP-Nav
- Set a new group with custom layout
- Deploy to staging.
Additional info
- Plugin version: 3.0.2
- Craft version: 3.4.4
ERROR OUTPUT:
Applying changes from project.yaml … error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (REMOTE_DB.craft_cpnav_navigation, CONSTRAINT craft_cpnav_navigation_layoutId_fk FOREIGN KEY (layoutId) REFERENCES craft_cpnav_layout (id) ON DELETE CASCADE)
remote: The SQL being executed was: INSERT INTO craft_cpnav_navigation (layoutId, handle, currLabel, prevLabel, enabled, order, url, prevUrl, icon, customIcon, type, newWindow, uid, dateCreated, dateUpdated) VALUES (2, ‘utilities’, ‘Utilities’, ‘Utilities’, 0, NULL, ‘utilities’, ‘utilities’, ‘tool’, NULL, ‘’, 0, ‘e9adca43-4669-4c41-bba8-0c184c50739b’, ‘2020-02-06 11:04:49’, ‘2020-02-06 11:04:49’)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 17 (15 by maintainers)
Fixed in 3.0.3
Originally from @andris-sevcenko
The first step would be to update Craft to the latest released version and then run a
./craft project-config/rebuild, I think.Otherwise, it’s hard to exclude bugs that have been already fixed and some minor project config discrepancies that might have crept in because of those bugs.
Spent some time tonight trying to reproduce this and I can’t. I can’t see how the data from a project config event would be null. I might ping @andris-sevcenko to see in what situations this can happen with project config…