Problem/Motivation

After changing the structure of Gutenberg config for the content type, the functional test UpdateAddMediaTest::testMediaUpdate() is no longer valid and can't be tested. So it was disabled in the context of https://www.drupal.org/project/gutenberg/issues/3415218

How these cases should be handled?

Issue fork gutenberg-3418917

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcofernandes created an issue. See original summary.

marcofernandes’s picture

Priority: Normal » Minor
marcofernandes’s picture

Issue summary: View changes
codebymikey’s picture

Added a relevant comment to the commit of the original PR here, but it's easy to miss, so adding as a comment here.


Can't see the specific code that breaks in the pipelines, but I believe this might be breaking due to the way the gutenberg_config_schema_info_alter() dynamically picks up schema fields at the moment (which isn't ideal).

At the point that $config_editable->set($key, $allowed_blocks)->save(); is called, Drupal attempts to validate the config according to the schema, but fails because the schema is still based off the "previous" config value before the media entity was enabled.

I believe since this is an update hook, switching to:

$config_editable->set($key, $allowed_blocks)->save(TRUE);

might yield better results since that won't trigger any config schema validation since we trust the data we pass into the updated config at that point.

But this begs a bigger question as to whether this crash due to new fields only happens under test environments, or will occur if you attempt to add Gutenberg support for new entity types on live sites (I don't believe it'll/should, but might need to explore further).

eiriksm made their first commit to this issue’s fork.

eiriksm’s picture

Status: Active » Needs review

Here's a suggestion for re enabling it ✌️

eiriksm’s picture

I added the other update hook inside the test so now the config does not end up in the wrong format

  • eiriksm committed 89e8a22a on 3.0.x
    Issue #3418917 by eiriksm, marcofernandes, codebymikey: Check...
eiriksm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.