-
Notifications
You must be signed in to change notification settings - Fork 16
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
Account for widget callbacks being array objects #93
base: master
Are you sure you want to change the base?
Conversation
Hi Folks, Any update about this pull request? The users still having problems with issue #64 https://wordpress.org/support/topic/php-recoverable-fatal-error-when-switching-amp-mode/ |
Hello there, The developers tried to replicate the issue in one of our demo site. Unfortunately, we did not encounter the same error or issues. For us to troubleshoot further, may we request for a staging site of the site with the issue? It might be related to other settings, plugins, and theme of the site. Thank you, |
Hi @medgedecastro, I will ask the user to share some information about his site, plugins and environment. Thanks, |
Hi @medgedecastro,
Location: /home/.../wp-content/plugins/widget-options/includes/widgets/extras.php:135 Can you take a look at the 2 commits from Weston? What else would you like to know? |
The error is happening during the page validation, to reproduce the error follow those steps:
|
We have pushed the suggested fixes. Thank you! |
Very nice. I noticed. 3.7.12 looks good so far |
@hollisterca But you've said the fix doesn't work? @medgedecastro In looking at the code deployed to WordPress.org, I don't see the changes applied: https://plugins.trac.wordpress.org/browser/widget-options/tags/3.7.13/includes/widgets/extras.php#L129 I still see: $id_base = is_array( $opts['callback'] ) ? $opts['callback'][0]->id_base : $opts['callback']; And not not the changes suggested in this PR. |
Just some feedback: |
It seems that the changes we need were gone when @edbertguinto push some updates. We will work on it. Thank you, |
We have pushed the suggested fixes. Can you please confirm it is reflecting on your end. |
@medgedecastro and @westonruter
|
@hollisterca That probably means it is working as expected. Previously validation could not be completed due to the fatal error, and so the amount of CSS was abbreviated and not all markup was rendered for AMP to validate. |
If there is no longer a fatal error, then it seems the Widget Options issue is fixed. |
Fixes #64.
See also support forum topic: https://wordpress.org/support/topic/php-recoverable-fatal-error-when-switching-amp-mode/
This implements a fix I proposed in another support topic: https://wordpress.org/support/topic/standard-template-mode-internal-error/#post-12547053
This fixes compatibility with the AMP plugin which wraps all the registered widget callbacks with an object that implements
ArrayAccess
.