I have a site that doesn't use a logo, so when I set up the AMP theme options I chose the option to not display a logo (by unchecking the box to use the default logo and not providing any other logo either). This works fine on normal pages. But on the AMP pages I get the following, followed by several lines of stack tracing:
Warning: get_headers() expects parameter 1 to be string, array given in amptheme_preprocess_html() (line 60 of themes/contrib/amptheme/amptheme.theme).
The problem is the theme is getting the url array and converting it to a string if the url is not empty. But if there is no logo you have an array and the url is empty, which isn't addressed. Then you end up trying to pass the array to get_headers(), which explodes.
I have a fix attached.
Comments
Comment #2
karens commentedComment #3
karens commentedThis error is still happening, but the patch file had a mistake in it. Trying again.
Comment #4
karens commentedStill wrong, one more try.
Comment #5
karens commentedComment #6
rainbowarrayThis will no longer be necessary with #2745227: Remove JSON output by AMP theme removing this logo URL parsing code.