#14579 closed task (blessed) (fixed)
Ajaxify list-type screens in the admin
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 )
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
Attachments (17)
Change History (186)
#5
@
14 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.
#6
@
14 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.
#9
@
14 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.
#15
follow-up:
↓ 17
@
14 years ago
How will custom columns fit into this? Additional hooks for plugins to provide the data to the ajax call?
#17
in reply to:
↑ 15
@
14 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:
#18
follow-up:
↓ 21
@
14 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.
#21
in reply to:
↑ 18
;
follow-up:
↓ 23
@
14 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.
#23
in reply to:
↑ 21
@
14 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.)
#24
@
14 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! :(
#31
follow-up:
↓ 32
@
14 years ago
Removal of register_column_headers() breaks popular plugins such as WP E-Commerce and MiniMeta Widget with an E_FATAL
#33
@
14 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..
#34
@
14 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/
#35
@
14 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:
#47
in reply to:
↑ 41
;
follow-up:
↓ 53
@
14 years ago
Replying to demetris:
Replying to scribu:
r15525 fixed the issue with the Recently Active, 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.
It seems this is fixed in current trunk (r15550) and now all views are remembered.
A different problem that I’ve been seeing since the beginning is that you cannot navigate between pages in themes.php. (You need more than 15 installed themes to see this.)
#55
@
14 years ago
Thanks for the quick fix.
Another issue that may be related to the ajaxification:
When I try to delete a plugin or theme, in the Connection Information screen the FTP password (saved and remembered by the browser) flashes once and then disappears. So, I have to re-enter it manually.
(This only happens for deleting. When I update themes/plugins everything works fine in the Connection Information screen.)
#66
follow-up:
↓ 67
@
14 years ago
The bottom group of bulk actions in plugins screens has not been working for some time now. I suppose it is something to do with the ajaxification.
I can look and narrow it down to a revision, if needed.
#67
in reply to:
↑ 66
@
14 years ago
Replying to demetris:
The bottom group of bulk actions in plugins screens has not been working for some time now. I suppose it is something to do with the ajaxification.
I can look and narrow it down to a revision, if needed.
This is because $_REQUESTaction? is never empty as it will either be the bulk action selected (from the top dropdown) or "-1" by default, therefore $_REQUESTaction2? (set by the lower bulk actions dropdown) never gets a chance. See attached patch for fix, change the default value of the bulk actions to be value='0' or alternatively could just be left blank (I think this is the case pre-3.1: value="")
#69
@
14 years ago
14579-lower-bulk.diff breaks the bottom bulk actions for posts (and probably in other places).
Working on a patch to make this consistent.
#71
@
14 years ago
Not very detailed as I haven't had time to look into this, but bulk actions (including Empty Trash button) on post type (posts, pages, CPTs) admin pages are not working.
And [15653] introduced a call to the list table get_columns()
function in list-table.php line 74 which is before $_screen
is instantiated, this raises a notice in the Media library. Just moving that call down a few lines will fix this, don't think it will mess with anything else.
#75
@
14 years ago
I'm guessing this is related to this ticket.
The behaviour on the 'post type' screens (I'm counting all of the items in the 2nd block of the admin menu) is inconsistent about showing the "Filter" buttons/dropdowns when there are no posts, pages, media items, etc... to display.
For example, if you have no Posts you still see dates/categories filter options and button, but for Media, Pages and CPTs you see just a "Filter" button, for Links you see an empty dropdown and a button, and Comments shows nothing. 3.0.1 shows none of this for any of the pages except comments which shows the dropdowns and buttons.
#77
@
14 years ago
- Cc admin@… added
Attached patch to remove @
error suppression and use array_key_exists instead.
#78
@
14 years ago
Generally better to use isset() or empty() checking for keys (depending), unless there's the possibility that a key's value could be null. In this case, we still want to return something.. Though I guess it would be null regardless if it doesn't exist.
#79
@
14 years ago
Learned something new today :) isset seems to be faster than array_key_exists.
Patch refreshed.
#86
@
14 years ago
[15925] creates invalid ID values if a directory separator is present in the plugin path
#88
@
14 years ago
Indeed. Besides slashes, there are a lot of other characters which would make the id invalid. Reverted.
#89
@
14 years ago
MediaWiki has a sanitizer class with a method to use on strings before using them as IDs or class names. Maybe borrow from there? (MW is GPLv2, just like WordPress)
#91
@
14 years ago
Pardon my incomplete research. I have a fondness for those MediaWiki functions because of their past usefulness to me... Next time I'll more thoroughly search WordPress's code before making a suggestion like that.
#92
@
14 years ago
(In [15939]) Clean list-table.js: when declaring JS object a comma after the last property is invalid, remove unused vars.
@
14 years ago
Reworks get_list_table() to conditionally include classes. Introduces require_list_table() to include core classes. Allows for plugins to prefix classes instead of by default forcing them into WP_*_Table.
#95
@
14 years ago
14579-rework-get_list_table.3.diff:
Rename filter to 'get_list_table' and apply it before calling require_list_table().
#99
@
14 years ago
About 1.86 MB of memory was saved on edit.php by only loading what we needed. As WP_Posts_Table is the largest class (nearly double the size of the next largest), the savings are surely greater on other pages.
#102
@
14 years ago
- Keywords needs-patch added; has-patch needs-testing removed
While loading items, a horizontal scrollbar appears; on all screens.
#107
@
14 years ago
I justed tested a plugin with the latest trunk which I started with WordPress 3.0. It uses a custom post type and the manage_edit-myposttpe_columns
filter to modify the columns in the edit screen. This works for the first page, but when I navigate to the second page (ajaxified), the default columns are shown.
I tracked this down to a change in [15956]. $current_screen
is used in the constructor of WP_Posts_Table
, so it needs to be set before creating the instance of this class. The attached patch fixes this.
#110
@
14 years ago
I was editing some link categories (debug enabled) and came across the following when trying to "quick edit" a category:
(Rev 16123)
PHP Notice: Undefined variable: type in \wp-admin\includes\list-table-terms.php on line 344 PHP Notice: Undefined property: stdClass::$taxonomy in \wp-admin\includes\list-table-terms.php on line 344
These are passed to the quick_edit_custom_box action. I'm not sure what they were supposed to represent - can they be removed altogether?
#129
@
14 years ago
r16182 re-introduced an issue:
Notice: Trying to get property of non-object in /f/www/dev.josephscott.org/public_html/wp/trunk/wp-admin/includes/class-wp-list-table.php on line 88
When replying to a comment in wp-admin.
#131
@
14 years ago
I wrote some code for testing that all the hooks in WP 3.0 can still be found in WP 3.1-alpha, after the ajaxification:
http://core.trac.wordpress.org/attachment/ticket/14579/test-list-tables.php
There don't seem to be any incompatibilities left.
That said, problems still remain:
#132
@
14 years ago
I think we need to drop sorting for columns that don't have an index. For example, display_name for the users list and registered for the sites list.
#134
@
14 years ago
I don't know if they're worth their weight. Those are both global tables that can be huge.
@
14 years ago
Restore "Submitted on" which was missing since 3.0. See the current Comments Help tab.
#140
@
14 years ago
It would be nice to have hashes for all ajaxified actions so that views are bookmarkable.
#141
@
14 years ago
@zeo: Thanks for the patches. Please keep in mind that no notifications are sent when you upload a patch is uploaded, so you should announce them in a comment.
#148
@
14 years ago
Ah, that's because themes.php uses 'pagenum' instead of 'paged'. I'll patch it up soon.
#151
@
14 years ago
hashes.14579.diff is an attempt to make ajaxified screens bookmarkable via URL hashes.
So far, the rows are updated based on the hash, but the other UI elements (sort arrow, search field, page field) are not.
#152
@
14 years ago
- Cc batmoo@… added
Patch fixes error notice for Comment Quick Edits.
Notice: Trying to get property of non-object in C:\wamp\www\wp31\wp-admin\includes\class-wp-list-table.php on line 8
#154
@
14 years ago
Patch sanitizes the entered page number before changing the page:
- Garbled, non-numeric text reverted to page 1 (currently returns NaN)
- Higher than total pages reverted to the last page
- Lower than page 1 reverted to first page
#158
@
14 years ago
Just a note on the "Loading..." text:
- Opera - Ends up as a block div ~200px? high above the header bar
- IE - Doesnt show at all
- FF - Loads and dims the rows as expected
#160
@
14 years ago
14579.network.users.fix.patch will fix problems with hidden columns on network users screen.
#164
@
14 years ago
I've noticed that when you sort by title in a list of hierarchical posts you loose the hierarchy indicators (which is what I would expect) but there seems to be no way to go back to the hierarchical listing without refreshing the entire page. Not having some way to revert could be confusing for people and while a page refresh will fix, that being the only way feels like it was just missed in the design process.
Had you considered this issue before and if so did I just miss how to get back to the hierarchical listing without refreshing the page?
#165
@
14 years ago
- Resolution set to fixed
- Status changed from accepted to closed
I replied here: http://core.trac.wordpress.org/ticket/15580#comment:36
I'm going to close this ticket now, as it's got pretty huge. Feel free to open new tickets for related issues.
The images go in wp-admin/images/