Problem/Motivation

After updating from WxT 5.6.1 to 6.3.0, the following message appears in the page footer:

InvalidArgumentException: Field field_link_provider is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 630 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

This error message is triggered in wxt_bootstrap_preprocess_paragraph() due to this line:

$field_definition = $variables['paragraph']->getFieldDefinition('field_link_provider');

I note that field_link_provider exists in WxT 6.3.0 on config/optional. There is no mention of it in WxT 5.6.1.

Proposed resolution

There should be a guard in wxt_bootstrap that checks for field_link_provider before calling ::getFieldDefinition().

Perhaps there should also be an update hook to create field_link_provider.

Remaining tasks

Confirm the correct solution. Implement.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

liam morland created an issue. See original summary.

liam morland’s picture

Title: Update hook missing for field_link_provider » Handle with missing field_link_provider
liam morland’s picture

Title: Handle with missing field_link_provider » Handle missing field_link_provider
liam morland’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

This patch is the contents of the pull request mentioned in #2.