metatag_computed fields create extra values to exports

Created on 3 November 2023, 8 months ago
Updated 29 May 2024, 18 days ago

Problem/Motivation

On a clean install with Metatag 2.0.0 and TMGMT 1.15 (or 8.x-1.x-dev with https://www.drupal.org/project/tmgmt/issues/3387162 📌 Support metatag 2 and avoid errors on complex (non-string) metatags Needs review applied), translation export seems to contain metatags that aren't configurable or translatable on the content.

Steps to reproduce

- composer require drupal/metatag drupal/tmgmt
- drush en metatag metatag_open_graph tmgmt tmgmt_content tmgmt_file
- Enable translation for Basic page: /admin/structure/types/manage/page → Language settings → Enable translation
- Create some language(s): /admin/config/regional/language/add
- Create a new page /node/add/page
- Navigate to the "Translate" tab on the node, check the untranslated language checkbox and click "Request translation"
- Click "Submit to provider"
- From the status message, download the exported file
- Open the file and see empty meta tags being present

Proposed resolution

The field with the issue is of type metatag_computed with its base field definition having a label of "Metatags (Hidden field for JSON support)". Currently tmgmt_content_field_info_alter() provides the field processor for various fields, including Metatag's field. Adding a new field processor for metatag_computed could be an option, or using the existing MetatagsFieldProcessor, or even skipping the whole field if it's not needed. I'm not familiar with Metatag 2.0 and its new structure so I'm not sure what should be done with this field.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Source: Entity

Created by

🇫🇮Finland iSampo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024