Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataForm: add author to quick edit page/post list #63983
DataForm: add author to quick edit page/post list #63983
Changes from 7 commits
271dac7
23d3904
16cda97
d88059f
216234e
f3053ac
1dff635
9bfa200
70e6966
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm aware, we didn't really use this function. The implementation is also wrong, because the
getValue
should return an integer (whatitem.author
is) instead of a string (the display name is arender
concern).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have a filter that uses this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary for filters, using the integer would be enough. However! Your comment makes me realize this is actually necessary for sorting: we should sort authors by name not by the id assigned by WordPress.
I'm going to bring back this, but sorting is not working on
trunk
. We need to look at that separately. There's a few issues (author & dates not sorting properly, the sort config in the table headers is not cleared properly):Gravacao.do.ecra.2024-07-26.as.13.23.26.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually raises an interesting question: if we have types but sorting depends on getValue, we can end up with the following (like in this case for
author
):integer
getValue
returns a stringHow do we make the sort utility work based on types in this scenario?
It seems we shouldn't use
getValue
for sorting and actually provide a custom sort utility if the field needs it. In that case, the filterSort utility would use the custom sort if it exists, otherwise would default to the sort defined by the field type. Thoughts?(nothing to do in this PR, as I brought back the
getValue
function 216234e but wanted to share for consideration when looking at fixing sorting and formalizing types)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked a bit more into this and it turns out
getValue
is not used for sorting either: we delegate on the REST API for filter/sort/rest in this page.The issues I've seen with sorting in
trunk
are:I removed the
getValue
to proceed with this PR.