Problem/Motivation
I noticed it when upgraded from 8.x-1.26 to 2.0.2. After executing post-updates not all fields were changed to json format. There is a small issue in _metatag_list_entity_field_tables() that empties $tables variable on each field storage iteration. As a result tables for the last one are returned
Steps to reproduce
- On 8.x-1.x add metatag fields to several entity types e.g. node and taxonomy term
- Upgrade to 2.x
- Look in the database. The node field still has serialized value and the taxonomy term has updated json values
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3483107-6.patch | 980 bytes | fernly |
Issue fork metatag-3483107
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:
- 3483107-fix-v2-upgrade
changes, plain diff MR !237
- 3483107-v2-post-updates
changes, plain diff MR !148
Comments
Comment #3
kadantsew commentedPlease review if this fix makes sense.
Comment #4
fernly commentedStable patch based on the MR.
Comment #5
fernly commentedAnd now the same patch with a logical filename.
Comment #6
fernly commentedAnd here's a working patch. Hiding the previous ones.
Comment #7
damienmckennaComment #8
damienmckennaYeah, well spotted - the outer if() statement sets $tables to an empty array if it's NULL, so no reason to set it to an empty array a second time.
Comment #12
damienmckennaCommitted. Thank you.