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

igonzalez created an issue. See original summary.

igonzalez’s picture

Title: Update problem to 8x-1.10 » Update problem to 8.1.10
bart lambert’s picture

follow, 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.

candalt’s picture

Can 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

bryandenijs’s picture

Priority: Normal » Major

Confirmed.
The allowfullscreen field is added to the IframeItem FieldType but the update hook is missing.
This breaks existing installations.

redeight’s picture

Experiencing 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)

redeight’s picture

Temporary 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?

bryandenijs’s picture

Version: 8.x-1.9 » 8.x-1.10

Writing 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.

neffets’s picture

Assigned: Unassigned » neffets
Status: Active » Fixed

Already done.

there is a reverted version 8.1.11
the new branch 8.x-2.x will test the twig development.

aburke626’s picture

I'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.

michaelprflores’s picture

I am also experiencing this error.

maximpodorov’s picture

Version: 8.x-1.10 » 8.x-1.11
Priority: Major » Critical
Status: Fixed » Active

The problem still exists in 8.x-1.11 version. Comparing to 1.9 version, field schema is changed, but no hook_update exists.

sametyaman’s picture

With 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 is field_<iframe_machine_id> and the other is field_<iframe_machine_id>_revision table, please add field_<iframe_machine_id>_allowfullscreen in both.
gngn’s picture

Thanx 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.

redeight’s picture

Status: Active » Closed (duplicate)
Parent issue: » #3091781: SQLstate column not found error after updating

Closing 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.