Problem/Motivation
The upgrade from 8.2 to 8.3 is supposed to created revision_user and revision_created fields on the block_content_field_revision table (via block_content_update_8003()). After the update however, with dynamic_entity_reference enabled, there are only _int versions of those fields:
mysql> describe block_content_field_revision;
+-------------------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------+------------------+------+-----+---------+-------+
| id | int(10) unsigned | NO | MUL | NULL | |
| revision_id | int(10) unsigned | NO | PRI | NULL | |
| langcode | varchar(12) | NO | PRI | NULL | |
| info | varchar(255) | YES | | NULL | |
| changed | int(11) | YES | | NULL | |
| revision_translation_affected | tinyint(4) | YES | | NULL | |
| default_langcode | tinyint(4) | NO | | NULL | |
| revision_created_int | int(10) unsigned | YES | | NULL | |
| revision_user_int | int(10) unsigned | YES | | NULL | |
+-------------------------------+------------------+------+-----+---------+-------+
Those _int fields are most likely coming from this module, but I have no idea a) why it doesn't create the normal fields too, and b) why it's doing so for a non-entity-reference field (the revision_created field).
There's this possibly related core issue too: #2865702: Revert schema version when update process failed..
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2895963-06.patch | 938 bytes | jhedstrom |
Comments
Comment #2
jhedstromOddly, this update hook was in 8.2, so now I'm not sure why/when this issue occurred. Will update as I find things.
Comment #3
jhedstromThe renaming of these fields from
revision_usertorevision_user_int(and the created one too) occurs duringsystem_update_8400(), which attempts to 'Move revision metadata fields to the revision table'.Comment #4
jhedstromOkay, I've tracked the issue down. The logic in
FieldStorageSubscriber::handleEntityType()is currently thinking thatrevision_userandrevision_createdare DER fields when triggered by the code insystem_update_8400(). This causesrevision_user_intandrevision_created_intand the corresponding triggers to be added to revision tables that then subsequently haverevision_userandrevision_createdremoved.This leads to a now-invalid trigger sitting on those tables, which leads to the errors reported over in #2865702: Revert schema version when update process failed..
I have no idea why this issue doesn't happen under normal conditions, and only appears during that update hook.
Comment #5
jhedstromOops, wrong version of the patch.
Comment #6
jhedstromGah, coding standard error.
Comment #7
jibranThanks, this looks legit.
Comment #9
jibranThanks, for the patch. Committed to 8.x-2.x.