You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrity constraint violation: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8665-1-24-0' for key 'PRIMARY'
The SQL being executed was: UPDATE changedfields SET layoutElementUid=CASE WHEN fieldId = 49 THEN '52e8858d-6c09-4778-8237-009ff6b00d1d' WHEN fieldId = 47 THEN 'ba709184-e786-4ac8-b6d9-3d900a87eaa4' WHEN fieldId = 26 THEN '546cb376-62bf-4e5d-b23d-4b3b7faa278a' ELSE '0' END WHERE elementId IN (SELECT DISTINCT id
FROM events_events
WHERE typeId=1)
Migration: verbb\events\migrations\m240921_000000_events3
I believe the error happens around line 215 to 242 on m240921_000000_events3.php
//
// Update Element Content
//
// Before proceeding, update the legacy Ticket Types and Ticket elements to have their content moved for Craft 4 > 5
// We'll need to do this to fetch field values for the new Ticket Types/Ticket elements.
$contentRefactorMigration = new BaseContentRefactorMigration();
// Use reflection to access the protected method
$reflectionClass = new ReflectionClass($contentRefactorMigration);
$updateElements = $reflectionClass->getMethod('updateElements');
$updateElements->setAccessible(true);
$eventTypes = (new Query())
->from('{{%events_event_types}}')
->all();
foreach ($eventTypes as $eventType) {
$query = (new Query())->from('{{%events_events}}')->where(['typeId' => $eventType['id']]);
if ($eventType['fieldLayoutId']) {
$layout = Craft::$app->getFields()->getLayoutById($eventType['fieldLayoutId']);
if ($layout) {
$updateElements->invoke($contentRefactorMigration, $query, $layout);
}
}
}
Steps to reproduce
In my changedfields table I have certain fields like this (id 8665 is an event element) where serveral rows have elementId, siteId, fieldId, and userId that is the same but with different layoutElementUid.
I tested (locally in ddev) deleting all rows where the fieldId was 0 in the table and the update and migrations seemed to work then, but I'm unsure of the consequences for doing so and would maybe like a proper solution
I'm wondering if there even should be multiple rows like this with different fieldId or if that's some sort of error?
Craft CMS version
5.4.6
Plugin version
3.0.0-beta.2
Multi-site?
No
Additional context
Currently doing all updating/testing and such in ddev locally for the moment
The text was updated successfully, but these errors were encountered:
Deleting the rows in changedfields is pretty safe in this instance, mainly because Events 3 is such a large refactor, any noted fields that have been marked as changed, likely are no longer valid.
I believe the changedfields database table is there to keep track of what fields have changed data with regards to drafts and delta updates, along with who has updated things.
Thanks for the reassurance. I thought they had to do something with drafts, just difficult to find documentation on what a craft tables in the database is for. I just opted for deleting those rows, and updating went smoothly.
Describe the bug
Trying to update from 3.0.0-beta.2 to 3.0.4 fails
I believe the error happens around line 215 to 242 on m240921_000000_events3.php
Steps to reproduce
In my changedfields table I have certain fields like this (id 8665 is an event element) where serveral rows have elementId, siteId, fieldId, and userId that is the same but with different layoutElementUid.
I tested (locally in ddev) deleting all rows where the fieldId was 0 in the table and the update and migrations seemed to work then, but I'm unsure of the consequences for doing so and would maybe like a proper solution
I'm wondering if there even should be multiple rows like this with different fieldId or if that's some sort of error?
Craft CMS version
5.4.6
Plugin version
3.0.0-beta.2
Multi-site?
No
Additional context
Currently doing all updating/testing and such in ddev locally for the moment
The text was updated successfully, but these errors were encountered: