WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#15336 closed defect (bug) (fixed)

AJAX plugin pagination issues

Reported by: johnbillion Owned by: scribu
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: needs-patch
Focuses: Cc:

Description

I'm out of the loop at the moment so forgive me if this is work in progress.

When paging through the Plugins screen (with the new AJAX pagination) the 'activate' and 'deactivate' links are missing.

To reproduce: Go to the Plugins screen and page through your plugins.

Tested at r16230. Marking as a blocker because, well, it is.

Change History (13)

comment:1 @nacin5 years ago

  • Milestone changed from Awaiting Review to 3.1

Reproduced.

comment:2 @westi5 years ago

(In [16231]) Ensure that booleans are booleans for now. See #15336.

comment:3 @westi5 years ago

  • Cc westi added

This is caused by the way the current_screen object is being re-incarnated.

Currently we trust whatever we receive in the GET request which is always going to be string data.

I've added the casts for now two force the two bools to be bools.

However, I'm not convinced this is the best solution for passing this data back from the JavaScript as it is now we blindly trust the data we receive.

Is any of it used in subsequent output?

comment:4 follow-up: @Utkarsh5 years ago

  • Cc admin@… added

$curent_screen ?

comment:5 in reply to: ↑ 4 @westi5 years ago

Replying to Utkarsh:

$curent_screen ?

Typo :-(

comment:6 @Utkarsh5 years ago

Still getting

An error has occured while loading the items.

AJAX response is

<b>Fatal error</b>:  Cannot use object of type stdClass as array in <b>..\wp-admin\admin-ajax.php</b> on line <b>57</b><br />

Should probably use ->is_network and ->is_user?

comment:7 @westi5 years ago

I need to drink more coffee before coding :-(

comment:8 @ocean905 years ago

  • Keywords needs-patch added

->is_network doesn't work too.
string(5) "false" with (bool) = bool(true)
:-(
See [16194]

comment:9 @westi5 years ago

(In [16234]) Fix typo. See #15336 props Utkarsh.
Also actually correctly cast to boolean :-)

comment:10 @scribu5 years ago

However, I'm not convinced this is the best solution for passing this data back from the JavaScript as it is now we blindly trust the data we receive.

Is any of it used in subsequent output?

Yes, of course it is used.

comment:11 @scribu5 years ago

I guess we could just pass hook_suffix and make set_current_screen() handle it.

comment:12 @scribu5 years ago

  • Severity changed from blocker to normal

comment:13 @scribu4 years ago

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

I'm going to call this fixed. Maybe find a better way to handle it in WP 3.2.

Note: See TracTickets for help on using tickets.