#40654 closed defect (bug) (fixed)
Undefined offset: 1 in /wp-admin/includes/dashboard.php on line 1227
Reported by: | FlyerUA | Owned by: | |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | major | Version: | 4.7.4 |
Component: | Administration | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
This happens at the home page of the Dashboard, from within WordPress News widget, when it tries to get a random popular non-installed plugin. Can be easily recreated every time by deleting transient _transient_dash_88ae138922fe95674369b1cb3d215a2b
from within the options table.
Attachments (4)
Change History (15)
#2
in reply to:
↑ description
@
8 years ago
Hi, psysolix.
I've tried on one site hosted on WP Engine (I'm not sure if Vagrant is used there) and on 2 sites (1 development and one was completely clean install for the sake of testing this bug) on my own VPS (Vagrant is not used for sure), so I'm pretty sure Vagrant has nothing to do with this bug.
I haven't tried plugin you've mentioned to see if it happens to me too.
And no, I haven't encountered any temp fix yet.
Also, I can't change priority. It's grayed out for me.
#3
follow-up:
↓ 4
@
8 years ago
FYI: 'list' logic has changed with PHP7, and 'array_pad' could be helping here.
#4
in reply to:
↑ 3
@
8 years ago
Oh, good thing you've mentioned it.
While my VPS does have 7.1.4, site hosted on WP engine has 5.6.30
#5
@
8 years ago
Confirmed bug is PHP version independent also seeing this on Multisite with PHP 5.5.38
#6
@
8 years ago
It looks to me like this happens because that row tries to explode a string by # but no # exists in the string. Here is line 1227
list($link, $frag) = explode( '#', $item->get_link() );
and here is a var_dump of $item->get_link()
string(42) "https://wordpress.org/plugins/woocommerce/"
That $frag doesn't look like it's being used anywhere, but it would have been populated with that "offset 1" mentioned in the error message if the string actually had a #.
#7
@
8 years ago
I'm getting these notices on several sites too, they started to pop up 2-3 weeks ago already.
Since $frag
variable is unused as @wfasa noticed, a simple way to stop getting the notices is to omit $frag
from list construct:
list($link, ) = explode( '#', $item->get_link() );
Hi FlyerUA,
I am having this issue as well, I suspected it was because of a configuration change by Vagrant. (VVV) Are you using Varying Vagrant for local development?
I also have this bug when installing/updating/ usage of duplicator plugin (when making package)
I'm changing it to Major Prio, because multiple people are affected.
https://wordpress.org/support/topic/undefined-index-and-undefined-offset/
Have you encountered a temp fix for it?
Thanks!