WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#14579 closed task (blessed)

Ajaxify list-type screens in the admin — at Version 44

Reported by: scribu Owned by: scribu
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: ongoing-project
Focuses: Cc:

Description (last modified by scribu)

This is the master ticket for my GSoC project.

What the patch does:

  • makes most columns sortable: #9259
  • introduces a new pagination style: #12179
  • ajaxifies sortable columns, pagination & search
  • provides an API for adding custom list screens: #11517
  • replaces WP_User_Search with get_users(): #14123
  • removes _wp_get_comment_list() in favor of get_comments(): #14163
  • makes bulk actions filterable: #12732
  • fixes problems with long URIs: #10762, #11114

Change History (47)

comment:1 @scribu5 years ago

  • Description modified (diff)

@scribu5 years ago

The images go in wp-admin/images/

comment:2 @scribu5 years ago

  • Owner set to scribu
  • Status changed from new to accepted

comment:3 @ryan5 years ago

Nice.

comment:4 @voyagerfan57615 years ago

  • Cc WordPress@… added

comment:5 @westi5 years ago

  • Cc westi added

Great to see the results of all your summer work as a mega patch.

It might be better to land this as incremental patches which achieve the different goals along the way so that it is easier to see what is changing and why.

Would it be much work to split down into per feature patches?

It wouldn't matter if there was an order in which we had to apply them it would just make it easier to review and commit.

comment:6 @scribu5 years ago

Would it be much work to split down into per feature patches?

Unfortunately, yes. Identifying the bugs that were fixed was a retroactive process.

It might be better to land this as incremental patches which achieve the different goals along the way so that it is easier to see what is changing and why.

You can take a look at my commit log to get a sense of what was changed and why.

comment:7 @scribu5 years ago

(In [15491]) Ajaxify list-type screens in the admin. See #14579

comment:8 @scribu5 years ago

Related: #14595.

comment:9 @nacin5 years ago

Awesomesauce.


Small things I noticed on first read. Note I only really looked at modified files:

AJAX fetch-list looks like it needs a cap/referer check. Also, die('-1') on insufficient privs, die('0') on failure.

default-list-tables.php -- I'm not sure I like an includes file having a require at the top. Also, should we split these tables up into individual files? Some of these classes are quite large.

template.php, right line 1817, this should be show_ui, not public.

minor style issues: false instead of FALSE, single if statements should not be on one line, we like our semicolons, CSS declarations should not be on one line, etc.

looks like merging turned wp-admin/network/*.php back into ms-*.php a bit.

<br class="clear"> in plugins.php and a few other places.

_wp_search_sql() probably doesn't need to be in functions.php.

Script localization needs the convert entities bit at the end.

jquery.query.js should be minimized. Also, the crunching of admin-table.js looks like it didn't touch local variables, also. munging is fine.


General concerns about back compat:

We obviously changed quite a bit of markup, as well as some CSS. Should the old CSS selectors remain, in order not to hurt the styling of old-style tables by plugins?

Renaming the "p" query arg on edit-comments, does that break anything? Is that the URL included in emails? Now it's longer… p should be an alias at least.

Probably need to deprecate, not outright remove, WP_User_Search. I did not carefully read through a lot of the red, so there may be other things we can't get rid of without breaking a lot of plugins.

comment:11 @scribu5 years ago

Related: #14596

comment:12 @automattor5 years ago

(In [15494]) Fix network files. See #14579

comment:13 @scribu5 years ago

(In [15495]) Fix ajaxification in network area by using ajaxurl. See #14579

comment:14 @ramoonus5 years ago

  • Cc ramoonus@… added

comment:15 follow-up: @jdub5 years ago

How will custom columns fit into this? Additional hooks for plugins to provide the data to the ajax call?

comment:16 @jdub5 years ago

  • Cc jdub@… added

comment:17 in reply to: ↑ 15 @scribu5 years ago

Replying to jdub:

How will custom columns fit into this? Additional hooks for plugins to provide the data to the ajax call?

You don't need to worry about AJAX at all. See this tutorial:

Create your own sortable columns

comment:18 follow-up: @demetris5 years ago

Two small issues I noticed in the Plugins screen, and that I confirmed on two different setups:

  • The rows in the Recently Active view do not show any info. See attached screenshot.
  • It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

@demetris5 years ago

Recently Active view of Plugins screen

comment:19 @scribu5 years ago

(In [15496]) Introduce WP_List_Table::check_permissions() and WP_List_Table::prepare_items(). Fixes #14596; See #14579

comment:20 @scribu5 years ago

(In [15497]) Fix Comments meta box in post editing screen. See #14579

comment:21 in reply to: ↑ 18 ; follow-up: @scribu5 years ago

Replying to demetris:

Two small issues I noticed in the Plugins screen, and that I confirmed on two different setups:

  • The rows in the Recently Active view do not show any info. See attached screenshot.

Confirmed.

  • It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

I think this has been fixed in [15496].

Another bug I noticed is that clicking on 'Delete' gives you an 'Are you sure you want to do this?' screen.

comment:22 @scribu5 years ago

Related: #14612

comment:23 in reply to: ↑ 21 @demetris5 years ago

Replying to scribu:

Replying to demetris:

It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

I think this has been fixed in [15496].

I am still seeing it in r15497. Confirmed on two different setups again. The query strings are like this:

http://example.com/wp-admin/plugins.php?deactivate=true&plugin_status=&paged=

(The plugin_status field has no value.)

@markmcwilliams5 years ago

network_admin_url(); / admin_url(); stuff

comment:24 @markmcwilliams5 years ago

The attached patch fixes the action links for wp-admin/network/sites.php which all mustn't have been sync'ed before you made the commit scribu, anyway, admin_url(); now becomes network_admin_url(); in the above patch! :) All links to the ms-*.php files currently! :(

comment:26 @scribu5 years ago

(In [15500]) In WP_Posts_Table, merge _single_row_hierarchical() and _single_row(). Fixes #14089; see #14579

comment:27 @scribu5 years ago

(In [15501]) Safer hierarchical display check. Fixes #14600; See #14579

comment:28 @scribu5 years ago

(In [15504]) introduce WP_List_Table::comments_bubble(); revert to edit-comments.php?p=123. See #14579

comment:29 @scribu5 years ago

Related: #14637

comment:30 @kawauso5 years ago

  • Cc kawauso added

comment:31 follow-up: @kawauso5 years ago

Removal of register_column_headers() breaks popular plugins such as WP E-Commerce and MiniMeta Widget with an E_FATAL

comment:33 @Lazy795 years ago

i still have a problem on one blog running with trunk.

on dashboard, post screen (..) it says

Fatal Error: Call to undefined method stdClass::get_column_headers() in template.php (/wp-admin/includes)

on plugin screen it works (of course). its sure because of a plugin (i think) but maybe it helps you in trunk / dev a bit..

comment:34 @scribu5 years ago

It would help if you could also figure out which plugin is causing it. Add this code to a file in your mu-plugins folder:

function scb_error_handler($errno, $errstr) {
	echo $errstr;
	
	ob_start();
	debug_print_backtrace();
	$out = explode( "\n#", ob_get_clean());
	$out = array_slice( $out, 1);
	echo '<pre>' . "\n#" . implode( "\n#", $out ) . '</pre>';
}
set_error_handler('scb_error_handler', E_WARNING|E_ERROR|E_RECOVERABLE_ERROR|E_USER_WARNING|E_USER_ERROR);

Then, please post back the displayed backtrace on http://wp.pastebin.ca/

comment:35 @Lazy795 years ago

Hi Scribu,

sorry i was stupid writing the post above. i figured out which plugin really makes this error (and thx for the function, its greadt!)

it is this plugin:

http://wordpress.org/extend/plugins/download-monitor/

comment:36 @scribu5 years ago

Related: #14651

comment:37 @scribu5 years ago

(In [15518]) use is_a() instead of is_object() in screen_meta(). See #14579

comment:38 follow-up: @scribu5 years ago

(In [15525]) Fix Recently Active plugins screen. See #14579

comment:40 @hakre5 years ago

Realted: #11517

comment:41 in reply to: ↑ 38 @demetris5 years ago

Replying to scribu:

(In [15525]) Fix Recently Active plugins screen. See #14579

r15525 fixed the issue with the Recently View, but it seems that the problem remains for other views.

For example, if you are on the Inactive view and activate a plugin, you are then sent to the All view.

comment:42 @demetris5 years ago

Correction:

s/Recently View/Recently Active/

comment:43 @scribu5 years ago

(In [15527]) On the plugins page, set and at the right time. See #14579

comment:44 @scribu5 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.