Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_iframe_allowfullscreen' in 'where clause': SELECT 1 AS expression FROM {block_content_revision__field_iframe} t WHERE (field_iframe_url IS NOT NULL) OR (field_iframe_title IS NOT NULL) OR (field_iframe_class IS NOT NULL) OR (field_iframe_width IS NOT NULL) OR (field_iframe_height IS NOT NULL) OR (field_iframe_frameborder IS NOT NULL) OR (field_iframe_scrolling IS NOT NULL) OR (field_iframe_transparency IS NOT NULL) OR (field_iframe_tokensupport IS NOT NULL) OR (field_iframe_allowfullscreen IS NOT NULL) LIMIT 1 OFFSET 0; Array ( ) en Drupal\Core\Entity\Sql\SqlContentEntityStorage->countFieldData() (linea 1800 de /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Comments
Comment #2
igonzalez commentedComment #3
bart lambert commentedfollow, having same problem here
in status report I also see following warning:
ENTITY/FIELD DEFINITIONS
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Content
The node.field_iframecode field needs to be updated.
Comment #4
candalt commentedCan confirm the issue and also comment number #3
Seems that there is a missing updatehook to add the new column "field_iframe_allowfullscreen".
Downgrading to 1.9 works
Comment #5
bryandenijsConfirmed.
The
allowfullscreenfield is added to theIframeItemFieldType but the update hook is missing.This breaks existing installations.
Comment #6
redeight commentedExperiencing this as well. Attempting to run entity updates doesn't appear to work either... (I'm assuming there isn't an update hook for this)
Comment #7
redeight commentedTemporary fix was rolling back the code to 8.x-1.9... that gets it working again. Does anyone know how to write update hooks for this?
Comment #8
bryandenijsWriting an update hook for a fieldType is complicated, because all fields of this type need to be updated.
The easiest solution is to delete the old iFrame fields and create new ones, but then you need to find a way to migrate the data.
I would suggest to make a new Major version of this module to at least make it clear that the 8.1.10 version is not compatible with the old version(s). So instead of version 8.1.10, make it 8.2.0.
Comment #9
neffets commentedAlready done.
there is a reverted version 8.1.11
the new branch 8.x-2.x will test the twig development.
Comment #10
aburke626I'm still getting the `node.field_iframe field needs to be updated.` error after updating to 8.x-1.11. I can see in info.yml that the version is showing version: 8.x-1.9. Cache clear, etc, didn't have an effect.
Comment #11
michaelprflores commentedI am also experiencing this error.
Comment #12
maximpodorov commentedThe problem still exists in 8.x-1.11 version. Comparing to 1.9 version, field schema is changed, but no hook_update exists.
Comment #13
sametyaman commentedWith this sql code, you can add the 'allowfullscreen' column that should be added for the corresponding field. You just need to change the
Important Note: You should do the same operation in the revision table.
ALTER TABLE `field_<iframe_machine_id>` ADD `field_<iframe_machine_id>_allowfullscreen` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Allow fullscreen for iframe. The iframe can activate fullscreen mode by calling the requestFullscreen() method.' AFTER `field_<iframe_machine_id>_tokensupport`;
Paragraph Field SQL Example:ALTER TABLE `paragraph__field_prg_iframe_content` ADD `field_prg_iframe_content_allowfullscreen` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Allow fullscreen for iframe. The iframe can activate fullscreen mode by calling the requestFullscreen() method.' AFTER `field_prg_iframe_content_tokensupport`;
Edit: When performing these operations manually, note that there are two tables pertaining to the respective field. One isfield_<iframe_machine_id>and the other isfield_<iframe_machine_id>_revisiontable, please addfield_<iframe_machine_id>_allowfullscreenin both.Comment #14
gngn commentedThanx at sametyaman #13.
I used the given Paragraph Field SQL statement to alter my tables (paragraph__field_iframe and paragraph_revision__field_iframe in my case).
But I still think we should offer an update hook...
I also think the release notes to 8.x-1.11 and 8.x-1.10 (8.x-1.9 also?) should include a warning.
Comment #15
redeight commentedClosing as duplicate of #3091781: SQLstate column not found error after updating
There are a bunch of issues popping up related to this... A hook_update is the way to fix this so existing sites aren't borked. Unless someone knows of a better best practice for D8 module schema updates. Requesting users to manually patch their database just isn't the kind of solution that seems reasonable by any stretch of the imagination.