Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glue for Yoast SEO & AMP conflict with AMP Stories #3041

Closed
jdelia opened this issue Aug 18, 2019 · 1 comment · Fixed by #3049
Closed

Glue for Yoast SEO & AMP conflict with AMP Stories #3041

jdelia opened this issue Aug 18, 2019 · 1 comment · Fixed by #3049
Labels
Bug Something isn't working
Milestone

Comments

@jdelia
Copy link

jdelia commented Aug 18, 2019

Using the latest beta version of the AMP plugin (Version 1.2.1-beta2-20190813T202856Z-ccd10eec), Yoast SEO (latest 11.3) and Glue for Yoast SEO & AMP (Version 0.4.3 ) is generating the following warning when viewing an AMP Story.

Warning: array_merge(): Argument #2 is not an array in /app/public/wp-content/plugins/amp/includes/class-amp-story-media.php on line 154

https://cl.ly/8f4e6e8130a7

Disabling the Glue for Yoast SEO & AMP plugin removes the warning. I've tested this on three sites all with the same warning. I did not receive a warning using the current 1.2.0 release of the AMP plugin.

@westonruter westonruter added this to the v1.2.1 milestone Aug 19, 2019
@westonruter westonruter added Bug Something isn't working AMP Stories labels Aug 19, 2019
@westonruter
Copy link
Member

Thanks for reporting.

The code in question is:

if ( ! isset( $data['image'] ) ) {
$data['image'] = [];
} elseif ( is_string( $data['image'] ) ) {
$data['image'] = [ $data['image'] ];
} elseif ( isset( $data['image']['@type'] ) ) {
$data['image'] = [ $data['image'] ];
}
$data['image'] = array_merge(
array_values( self::get_story_meta_images() ),
$data['image']
);

This code comes from #2930.

I'm guessing it is due to the Yoast AMP Glue plugin doing something here:

https://github.com/Yoast/yoastseo-amp/blob/876424820e752c1042ae12e0233d59bc4f0d5478/classes/frontend.php#L221-L223

I thought the AMP Stories code accounted for this however. This could ultimately be a bug with the Yoast AMP Glue plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants