-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Undefined index: description in [...]/plugins/gutenberg/lib/widgets.php on line 98 #14552
Comments
Describe the bug See anspress/anspress#515 but I think it might be something in GB rather then a anspress bug. I see this when trying to edit a page (with no content on it at all). The error only appear when Gutenberg 5.3.0 plugin and anspress are active. The version of GB that comes with WP 5.1.1 does not have this problem. I have only GB and Anspress plugins active.
To Reproduce
Expected behavior |
Seems related to this PR somehow #13569 cc @aduth @jorgefilipecosta |
@nextgenthemes I do not have anspress. I think it's something with GB. I also got this issue, after update GB plugin. |
I suspect this line as the likely culprit: Line 98 in 9bcf036
Specifically the property reference This was adapted in #13569 from #13511 . The obvious fix may be to consider Noting also that depending on E2E coverage, this may have been discovered if something like #13452 were introduced into our test workflow. |
Based on the following, it appears that it's not guaranteed to be set:
Given the availability of |
Hi @strarsis, @nextgenthemes, @chapterjason thank you for sharing details about this issue, and for the referencing anspress which easily allowed me to reproduce the bug. Hi @aduth thank you for your explorations and around this problem, and the insights you provided.
I think introducing this type of tests would be a nice improvement to our coverage, but unfortunately, I think this bug would still not be caught because we need a class widget without a description installed.
Unfortunately, in this specific case, I was not able to use the function wp_widget_description. The function receives a widget id. The widget only exists for widget specific widget instances. In part of the code, we are interacting on all widget classes even if no widget instance (and id) exists at all. We need this logic because the user may have just installed a plugin, did not add/created any widget using it, but may still want to use it in a legacy widget block. |
## Description Fixes: #14552 We were not checking in the widget description was set and on widgets, without description, an undefined notice was being thrown. ## How has this been tested? I installed the AnsPress Question Answer plugin: https://wordpress.org/plugins/anspress-question-answer. I created a new page and verified and checked Undefined notice was not being thrown in the PHP code. In master, a notice should appear.
Describe the bug
Notice is shown, also obstructing the editor area.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No notice (notices + warnings enabled on dev server).
Additional context
This appeared after updating Gutenberg to latest release (5.3.0).
The text was updated successfully, but these errors were encountered: