remove_robots_noydir_noodp: TypeError: explode(): Argument #2 ($string) must be of type string, array given

Created on 28 May 2023, about 1 year ago
Updated 30 May 2023, about 1 year ago

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

πŸ› Bug report
Status

Fixed

Version

1.24

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jan kellermann

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

Comments & Activities

Production build 0.69.0 2024