Opened 15 years ago
Closed 15 years ago
#12854 closed defect (bug) (duplicate)
Link manager causes PHP warning
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Symptom:
Link manager throws a PHP warning.
Steps to reproduce:
- Install WP 3.0-beta
- Enter the dashboard
- Go to "Links"
- Receive one warning per link stating "Warning: array_map() [function.array-map]: Argument # 2 should be an array in /.../wp-includes/bookmark.php on line 316"
Possible cause:
sanitize_bookmark() wrongly assumes 'link_category' to be an array while actually it is read as a integer from $wpdb->links.
Possible root cause:
Apparently, get_bookmarks() does not populate the 'link_category' member from the taxonomy table like get_bookmark() does. This might be unintentional.
Change History (22)
#5
@
15 years ago
- Cc matt@… added
I have not been able to duplicate this issue, at least not on HEAD nor on revisions 13500, 13600, 13700, 13800, 13900, 14000. Fresh install installs were used in all tests.
Install WP, log in, go to Links->Edit Links (Just clicking on the Links parent menu item takes you here).
I even added debugging directly before that array_map call and $value was always an array.
#7
follow-up:
↓ 8
@
15 years ago
I just upgraded to last night's nightly and I'm still seeing this:
Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316 Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/ipstenu/public_html/blog/wp-includes/bookmark.php on line 316
Happens on both blogs I've got on WP 3.0
#8
in reply to:
↑ 7
@
15 years ago
Since I can't edit .. Both blogs were upgrades from 2.9 which now that I re-read sivel's comment, I wonder if that's related.
One blog is Multi-site, one is single.
#10
@
15 years ago
More info that's just going to make my head hurt.
Running WP Multi Site. UPGRADED blogs (ie ones that had been on Multi-site 3.0-alpha) have the link page error. I just created a new blog on that multi site and ... The link page work.
#12
@
15 years ago
I applied the diff you posted and it still borks.
That sounds as good an explanation as any as to the problem. Let me know if there's anything I can test for you.
#13
@
15 years ago
Okay, I think I've got it (or rather, I think I know where it's weird).
In my existing blogs, I have a field for 'link_category' in my database under wp_links
The new blog didn't have that! I dropped the field and the error went away!
Now, how to fix that other than to poke the DB? No idea, but that works. No errors in my error_log either
#15
@
15 years ago
Interesting. Only two people have reported it. I wonder if it's specific to servers or if most people just don't look at their links page often enough to notice.
Both of my blogs went from 2.5 (I think?) to 2.8 to 2.9, hitting every update along the way. I have one still on 2.9 that started life on 2.9 and it DOES NOT have link_category.
#16
@
15 years ago
- Version set to 3.0
Hi,
I have the same error
http://u.wikichaves.com/3de9eb5bdddb11fc2f934d205eca6e66.png
- Updated from 2.9.2
- Bluehost server
- Updated nightly build and still happens
wikichaves
#18
@
15 years ago
Had the same thing - a much-upgraded site still had the link_category field in wp_links. Dropping the field removed the issue.
As ipstenu suggests, I very rarely look at my links, and only went there today because I spotted that a plugin that I don't use any more had inserted a link for itself which I wanted to remove...
This is still happening on the latest nightly.