Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#15336 closed defect (bug) (fixed)

AJAX plugin pagination issues

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

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)

#1 @nacin
16 years ago

  • Milestone Awaiting Review3.1

Reproduced.

#2 @westi
16 years ago

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

#3 @westi
16 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?

#4 follow-up: @Utkarsh
16 years ago

  • Cc admin@… added

$curent_screen ?

#5 in reply to: ↑ 4 @westi
16 years ago

Replying to Utkarsh:

$curent_screen ?

Typo :-(

#6 @Utkarsh
16 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?

#7 @westi
16 years ago

I need to drink more coffee before coding :-(

#8 @ocean90
16 years ago

  • Keywords needs-patch added

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

#9 @westi
16 years ago

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

#10 @scribu
16 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.

#11 @scribu
16 years ago

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

#12 @scribu
16 years ago

  • Severity blockernormal

#13 @scribu
16 years ago

  • Resolutionfixed
  • Status newclosed

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.