Problem/Motivation
While database update from 8.x-1.22 to 1.24 the updates aborts with error:
> TypeError: explode(): Argument #2 ($string) must be of type string, array given in /XXX/modules/contrib/metatag/metatag.post_update.php on line 304 #0 /XXX/modules/contrib/metatag/metatag.post_update.php(304): explode()
Adding some debug-output show, that `$tags['robots']` is already an array:
Array
(
[index] => 0
[noindex] => 0
[follow] => 0
[nofollow] => 0
[noarchive] => 0
[noodp] => 0
[nosnippet] => 0
[noydir] => 0
)
Output of field-value in $record:
[field_event_meta_value] => a:1:{s:6:"robots";a:8:{s:5:"index";i:0;s:7:"noindex";i:0;s:6:"follow";i:0;s:8:"nofollow";i:0;s:9:"noarchive";i:0;s:5:"noodp";i:0;s:9:"nosnippet";i:0;s:6:"noydir";i:0;}}
Steps to reproduce
Doing database update.
Proposed resolution
Using patch for testing if it is already an array.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
jan kellermann commentedComment #3
damienmckennaThank you for reporting the bug and providing a patch. I'll review it in the next few days.
Comment #4
damienmckennaWill need to expand the test coverage to make sure the data is correct.
Comment #5
damienmckennaImproved basic patch.
Comment #6
damienmckennaComment #9
damienmckennaCommitted, and I added some example robots values to the v1 fixture, which we can turn into test coverage later. Thank you.