-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Set author display name on Post / Page creation, send author changes to API. #16269
Set author display name on Post / Page creation, send author changes to API. #16269
Conversation
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.
Thanks for catching this bug where self-hosted post authors don't show up properly in the post list. Would this be best addressed in a new issue and this PR target develop
instead of the feature branch?
I smoke tested this on a self-hosted site and it looks to fix the issue on the post list screen of authors not showing up. I had trouble testing the effects to the edit history screen, I couldn't get the History option to appear in the bottom sheet in the editor when I tap the three-dot menu. I might be missing something, did you run into this?
A few comments on the PR itself:
This PR may help resolve a UI bug where a WordPress.org site doesn't show the author in the list of posts when viewing for "Everyone", and the user is an Administrator.
If this bug is independent from #9015, that would be a point in favor of making a separate issue for this bug.
I'm not clear from the PR whether this bug affects only self-hosted (WordPress.org) sites, or also affects WP.com (a separate issue for this bug could help us triage it).
Could the testing steps be more descriptive to specify what to expect with regard to the Post list screen?
Just a few nitpicks:
- Is there a PR title that better describes the issue?
- The screenshots on the PR are very large (I sometimes use a HTML img tag to adjust the width to something like 350px).
I think that's a great idea, will do.
I ran into this as well, and assumed it's not a feature of self-hosted sites. I'll look into that some more. 👍
Agreed. It was a "nice bonus" that appeared, but I'll make it the main driver for the fix.
Sure - I'll make this clear in the dedicated bug issue for it.
Agreed, will improve that.
Good call, will do. Thanks! |
The PR should be updated now to address these issues. Thanks! |
You can trigger an installable build for these changes by visiting CircleCI here. |
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 code should have no effect on the current app.
Would it be possible to have testing steps, even if they involve diving into code in the IDE (e.g. putting breakpoints on certain lines and printing values, etc.)?
Also, could you please link to the API documentation showing where these parameters are expected when publishing a post (i.e. author display name, etc)? At first glance it seems like a post wouldn't need more than an authorID, but I can imagine that it might need display name in case the author is then deleted. Just want to corroborate with the API documentation here.
Hi @guarani, thanks for the feedback! I've updated the description of the PR to hopefully fit these suggestions, but please let me know if I need to expand any areas. |
I bumped the milestone to 17.3 since I just realized that there's no reason (I can think of) to try to get this into 17.2 which is cut Monday (something I'd overlooked when adding a milestone earlier). |
Thanks for the updates, @twstokes! I see the build tests are failing: Are you able to look into that? If you don't have access, or there's an error that you don't recognize, just let me know and I can help. |
I saw that @guarani, and it looks like Do you have the ability to try a re-run? It doesn't look like I'm privy to that. Thank you! |
Actually @guarani let me resolve these merge conflicts, first. Thanks! |
…be available in the settings UI.
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
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 tested on a WP.com site and LGTM! From your comment here sounds like we won't merge this until Tuesday.
Excellent. Thank you @guarani! |
Just a heads-up that the 17.2 branch is now cut: https://github.com/wordpress-mobile/WordPress-iOS/tree/release/17.2 |
Sounds good @guarani, I'll resolve the merge conflict by pointing to the appropriate WordPressKit and push the changes. |
This reverts commit 17406b8.
I noticed the changes to the Podfile were reverted in 4f50606. I think my comment in wordpress-mobile/WordPressKit-iOS#381 (review) might have been misleading. With the second option I mentioned there, we still need to tag a new WordPressKit beta release after merging its PR and we then need to point this PR to it, and merge this. I've gone ahead and made the release here: https://github.com/wordpress-mobile/WordPressKit-iOS/releases When this PR is updated to point to the tag, I can trigger the CI to run again and we can get this merged 👍 |
Sorry I misunderstood @guarani! I believe this is now resolved with the latest push. |
I've enabled auto-merge and re-triggered the CI, so with a bit of luck this should get automatically merged once CI has passed. |
This is one PR in a series towards implementing #9015.
This PR is branched from #16298, so it should be merged first.
Affected areas:
This PR aims to accomplish two things:
Sending an updated authorID when an author is changed for a Post or Page.
Why: To support a future PR (Feature: Allow the user to change the author for multi-author sites for Posts and Pages #16281) we want the value of the author user ID to be sent to the API. Currently it's not sent. This PR updates the
RemotePost
'sauthorID
value so that it will be picked up by WordPressKit (see PR: Include Author ID in Post Service parameters. WordPressKit-iOS#381) and ultimately sent to the API. REST API reference 1, reference 2, XML-RPC API reference 1 (seewp.newPost
andwp.editPost
).Setting an author user ID and display name on a newly created Post or Page.
Why: To support a future PR (Feature: Allow the user to change the author for multi-author sites for Posts and Pages #16281) we want the author display name and author user ID to be known on Post or Page creation to allow changing an author for a multi-user blog. We must know both so that the user interface can show the author's name (by default, theirs), and showing the currently selected author (which is determined by the author ID) in the author list. Currently, neither of these are set.
The ability to change an author in the UI will be provided in an upcoming PR: #16281
To test:
Local changes to the author
PostsTests
. Manipulating this from the app interface isn't currently possible, but will be in Feature: Allow the user to change the author for multi-author sites for Posts and Pages #16281.Setting the authorID and author name on Post and Page creation
EditPageViewController:56
andEditPostViewController:127
.newPost
ornewPage
).newPost
andnewPage
should have a populatedauthor
andauthorID
field.The authorID is now sent on Post / Page creation and modification
PostService.m:266
.remotePost
contains theauthorID
.Regression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.