Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#28843 closed defect (bug) (fixed)

Fatal error: Call to protected method ... on PHP 5.2.5

Reported by: ipstenu's profile Ipstenu Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.0 Priority: high
Severity: blocker Version: 4.0
Component: General Keywords:
Focuses: Cc:

Description

Reported here: https://wordpress.org/support/topic/fatal-error-1264?replies=12&view=all

Errors:

Fatal error: Call to protected method WP_List_Table::get_pagenum() from context '' 
in C:\wamp\www\wordpress\wp-admin\plugins.php on line 16

and

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected
to be a valid callback, 'WP_Comments_List_Table::_js_vars' was given in
C:\wamp\www\wordpress\wp-includes\plugin.php on line 488

there are no errors on PHP 5.4

Possibly related to #27881 or #22234 ?

Attachments (1)

28843.patch (6.0 KB) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (12)

#1 @wonderboymusic
10 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Awaiting Review to 4.0

Any weird plugins or themes installed? My hunch is that someone is calling this method statically, which I have little sympathy for. Worst Case Scenario: I'll remove the access modifier, but this sounds a like a busted install or whack code.

#2 @Ipstenu
10 years ago

That's what I thought, but when I asked, she did a totally fresh install:

"On a new install on WAMP server 2.0 with PHP 5.2.5 there is the error :
Warning: Wrong parameter count for array_unique() in C:\wamp\www\wordpress4\wp-includes\taxonomy.php on line 2348"

I don't have an (easy) way to test PHP 5.2.5 but the user swears it didn't happen on 5.4 so ... I;m thinking derpy PHP?

#3 @helen
10 years ago

Second param for array_unique() was added in 5.2.9, so yes, that is a problem.

#4 @SergeyBiryukov
10 years ago

  • Keywords reporter-feedback removed
  • Priority changed from normal to high
  • Severity changed from normal to blocker

I can reproduce all the issues mentioned here on a clean install on PHP 5.2.4 (minimal required version).

Introduced in [28493] and [28583].

28843.patch fixes the access modifier issues for me. Doesn't touch the array_unique() issue.

#5 @wonderboymusic
10 years ago

In 29118:

Repent for our original OOP sins and doc blocks as pertains to access modifiers in List Table + subclasses.

Props SergeyBiryukov.
See #28843 and [28583].

#6 @wonderboymusic
10 years ago

In 29119:

The 2nd argument to array_unique() was added to PHP in 5.2.9, so don't use it. We have to use our own code to return unique terms when fields => all in wp_get_object_terms().

See #28843 and [28583].

#7 @Ipstenu
10 years ago

Per user report, the user_func_array issue is still happening

https://wordpress.org/support/topic/warning-call_user_func_array-22?replies=5

Sorry for the bad report, I'm on my phone.

#8 @luciole135
10 years ago

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'WP_Comments_List_Table::_js_vars' was given in C:\wamp\www\wordpress4\wp-includes\plugin.php on line 488

On dashboard with PHP 5.2.5 on a new install and on an update

If I disable the dashboard_activity widget with the function unset, there are no errors:
unset ($ wp_meta_boxes ['dashboard'] ['normal'] ['core'] ['dashboard_activity']);

Last edited 10 years ago by ocean90 (previous) (diff)

#9 @wonderboymusic
10 years ago

I'm going to do a painful audit of every class in WP to determine what methods are used publicly but aren't marked as such.

#10 @wonderboymusic
10 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 29137:

Fix mismatches in access modifiers for WP_List_Table + subclasses.

Fixes #28843, #28879.

#11 @luciole135
10 years ago

It work fine, now great job.

Note: See TracTickets for help on using tickets.