Mismatched entity and/or field definitions: The User ID field needs to be updated. v2

Created on 18 July 2024, 3 months ago

Problem/Motivation

This is a followup from 🐛 Mismatched entity and/or field definitions: The User ID field needs to be updated. Fixed .

Upgrading from 2.0.0-rc-16 to 2.0.2 we are getting the error mentioned by @kasperg

>  [error]  Exception thrown while performing a schema update. SQLSTATE[01000]: Warning: 1265 Data truncated for column 'uid' at row 1: ALTER TABLE "eventseries_field_revision" CHANGE "uid" "uid" INT unsigned NOT NULL COMMENT 'The ID of the target entity.'; Array
> (
> )
>
>  [error]  Update failed: recurring_events_update_91002

Steps to reproduce

  • Install recurring_events 2.0.0-rc-16
  • Update to 2.0.2
  • Run drush updb

Proposed resolution

Add try/catch blocks to update the fields if they already exist.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Recurring Events (Main module)

Created by

🇪🇸Spain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @plopesc
  • Status changed to Needs review 3 months ago
  • 🇪🇸Spain plopesc Valladolid

    Created MR

  • Pipeline finished with Success
    3 months ago
    Total: 141s
    #227737
  • Pipeline finished with Success
    about 2 months ago
    Total: 191s
    #262546
  • 🇧🇬Bulgaria pfrenssen Sofia

    I cannot replicate this on a clean install. Installed 2.0.0-rc16, then switched to 2.0.2 and ran database updates. Goes through without errors.

    Does this perhaps require a certain database version? I tried on Drupal 10.4.x using MariaDB 10.11.8.

  • 🇧🇬Bulgaria pfrenssen Sofia

    Could not replicate with MySQL 5.7.44.

  • 🇧🇬Bulgaria pfrenssen Sofia

    I can replicate it with MySQL 8.0.36, but a required step was missing from the instructions. Updating issue summary.

    The error under MySQL 8.0.36 is:

    SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value: ALTER TABLE "eventseries_field_revision" CHANGE "uid" "uid" INT unsigned NOT NULL COMMENT 'The ID of the target entity.';

    However the proposed fix is not solving the problem correctly. The update is skipped, and the mismatched field definition warning remains in the status report.

Production build 0.71.5 2024