Skip to content
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

Author picker doesn't default to current author #5072

Closed
karmatosed opened this issue Feb 15, 2018 · 23 comments
Closed

Author picker doesn't default to current author #5072

karmatosed opened this issue Feb 15, 2018 · 23 comments
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@karmatosed
Copy link
Member

The dropdown shows like this:

2018-02-15 at 11 46

Whilst it doesn't save to a different author until you save it, not showing the author that is writing seems a little odd as an experience. Could this default to the logged in user? I know this may come from core but it feels like an awesome enhancement and visual indicator of who is writing.

@darrencoutts118
Copy link

I can see a potential for people accidentally saving a post as someone else. and given the politics of some organisations, that could be a big content issue. Certainly should default to the person who is editing

@youknowriad
Copy link
Contributor

I'm not able to reproduce this issue personally, I think it's probably related to the fact that this website has more than 100 authors which is the limit of the current API. Is this the case here?

In which case the solution should be to work on a paginated selector somehow. Maybe scrolling could fetch other pages or something? In addition to fetching the current author initially.

@karmatosed
Copy link
Member Author

karmatosed commented Feb 17, 2018

I can reproduce this on any site. Even with 2 users, it only shows the first user selected alphabetically. The issue is about defaults, it should default to show the existing user no matter how many authors.

@youknowriad
Copy link
Contributor

The issue is about defaults, it should default to show the existing user no matter how many authors.

I didn't reproduce in my testings but I'll take another look.

@bobbingwide
Copy link
Contributor

bobbingwide commented Feb 27, 2018

I believe I can reproduce this problem.
@karmatosed Can you confirm whether or not you have a meta box?

In my development environment two requests are sent to the server.
The first, a REST request, contains the correct value for the new author. ( author: 1 in my example )

The second is the meta box request

/hm/wp-admin/post.php?post=21219&action=edit&classic-editor=1&meta_box=1

This request contains the original value for the post_author. ( post_author=2 in my example )

Both requests update the post, but the second one trumps the first.
This can be seen from the incorrect value for post_author and later values for post_modified and post_modified_gmt

Below are traces of the SQL update statements.
REST request

[bw_sql 10 0.075205 wp_insert_post]UPDATE `wp_posts` SET `post_author` = 1&comma;  `post_date` = '2018-02-10 08:03:41'&comma;  `post_date_gmt` = '2018-02-10 08:03:41'&comma;  `post_content` = '<!-- wp:paragraph -->\n<p>Categories and Tags holds all the Categories and Tags including Custom taxonomies.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>The Categories meta box displays the selected categories associated with the content.<br/> Custom Category meta boxes display the same.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>[bw_fields featured]</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Maps to [bw_link 21213]</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Known Issues </p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p></p>\n<!-- /wp:paragraph -->'&comma;  `post_content_filtered` = ''&comma;  `post_title` = 'Categories and Tags'&comma;  `post_excerpt` = ''&comma;  `post_status` = 'publish'&comma;  `post_type` = 'sidebar'&comma;  `comment_status` = 'closed'&comma;  `ping_status` = 'closed'&comma;  `post_password` = ''&comma;  `post_name` = 'categories-and-tags'&comma;  `to_ping` = ''&comma;  `pinged` = ''&comma;  `post_modified` = '2018-02-27 12:41:02'&comma;  `post_modified_gmt` = '2018-02-27 12:41:02'&comma;  `post_parent` = 0&comma;  `menu_order` = 0&comma;  `post_mime_type` = ''&comma;  `guid` = 'https://qw/hm/?post_type=sidebar&#038;p=21219' WHERE `ID` = 21219[/bw_sql]

Meta box update

[bw_sql 19 0.155122 wp_insert_post]UPDATE `wp_posts` SET `post_author` = 2&comma;  `post_date` = '2018-02-10 08:03:41'&comma;  `post_date_gmt` = '2018-02-10 08:03:41'&comma;  `post_content` = '<!-- wp:paragraph -->\n<p>Categories and Tags holds all the Categories and Tags including Custom taxonomies.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>The Categories meta box displays the selected categories associated with the content.<br/> Custom Category meta boxes display the same.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>[bw_fields featured]</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Maps to [bw_link 21213]</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Known Issues </p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p></p>\n<!-- /wp:paragraph -->'&comma;  `post_content_filtered` = ''&comma;  `post_title` = 'Categories and Tags'&comma;  `post_excerpt` = ''&comma;  `post_status` = 'publish'&comma;  `post_type` = 'sidebar'&comma;  `comment_status` = 'closed'&comma;  `ping_status` = 'closed'&comma;  `post_password` = ''&comma;  `post_name` = 'categories-and-tags'&comma;  `to_ping` = ''&comma;  `pinged` = ''&comma;  `post_modified` = '2018-02-27 12:41:03'&comma;  `post_modified_gmt` = '2018-02-27 12:41:03'&comma;  `post_parent` = 0&comma;  `menu_order` = 0&comma;  `post_mime_type` = ''&comma;  `guid` = 'https://qw/hm/?post_type=sidebar&#038;p=21219' WHERE `ID` = 21219[/bw_sql]

The result is that the Author isn't updated.

Proposed solution - pass the latest value for the Author field as post_author.
If Tammie cannot confirm that my scenario is similar to hers then we'll have to raise a new issue.

@youknowriad
Copy link
Contributor

Good exploration @bobbingwide we had a similar issue with other fields (comment and ping status), we should probably update the additional fields here when saving the meta boxes

https://github.com/WordPress/gutenberg/blob/master/edit-post/store/effects.js#L64-L67

@bobbingwide
Copy link
Contributor

While you're there check the spelling of overriden. L62 :-)

@karmatosed
Copy link
Member Author

karmatosed commented Feb 28, 2018

I wasn't testing with metaboxes.

@bobbingwide
Copy link
Contributor

I'll have to raise a separate issue then.

With regards to your problem.
When you click on the drop down is the current author highlighted?
In the classic editor one of the options in the drop down list has selected="selected".
I couldn't see this in the Gutenberg version.

@bobbingwide
Copy link
Contributor

Perhaps I don't understand the problem.
Who is the author of the post you're editing and who are you logged in as?

When logged in as mick, if I edit a post created by herb then I expect the author to be displayed as herb until I change it.

@gziolo
Copy link
Member

gziolo commented Mar 9, 2018

It should be fixed with #5438. I wasn't able to reproduce the issue anymore. Can you confirm?

@gziolo gziolo closed this as completed Mar 9, 2018
@StaggerLeee
Copy link

StaggerLeee commented Apr 19, 2018

In latest version author name is cut. 1/3 of admin author name (bottom) is cut, outside dropdown select box.
The same problem with "Post Format" select.
wp-admin select high of 28px is making this.

.wp-admin select {
    height: 28px;
}

@gziolo
Copy link
Member

gziolo commented Apr 20, 2018

Can you share a screenshot? Ideally, with developers console enabled so we could see what styles get applied? I couldn't reproduce locally. I asked @jasmussen about the same and he also didn't see the issue.

@StaggerLeee
Copy link

StaggerLeee commented Apr 20, 2018

Difficult to make screenshots with much of inspector visible. Even when positioned right, whole height.
I just checked on one other website, installation.

  • Previous version did not have this problem, all nice.
  • Guessed it will happen when I update it to latest version. And I was right, author name is cut.

So, previous version OK, last version not OK.
I checked in inspector and cannot see any non-core CSS file influencing select.

I will test it now with Plugin organizer. Disable all plugins in backend.

Edit: Disabled all plugins in backend, except Gutenberg. Still cut out. Tested with one of the default themes too.

@StaggerLeee
Copy link

@StaggerLeee
Copy link

Possibly the same: #6326

@jasmussen
Copy link
Contributor

Thanks for the screenshot, and yeah that other ticket is definitely the same. I know what it is and will fix monday. Thanks!

@StaggerLeee
Copy link

Hi @jasmussen. Notice Title of Article. I did not touch it. Is there any smart way to prevent look like this ? Does not look very professional.

@jasmussen
Copy link
Contributor

Hmm yeah I'll take a look at that too.

@StaggerLeee
Copy link

Thank you.
It comes randomly, when screen is smaller in width. I cannot force it allways when pressing F5.

Error console is clear, no errors.

@gziolo
Copy link
Member

gziolo commented Apr 23, 2018

Thanks, I moved your comments to #6326 to make it easier to track since this issue is closed 👍

@jasmussen
Copy link
Contributor

It comes randomly, when screen is smaller in width. I cannot force it allways when pressing F5.

I can reproduce, occasionally, when typing a very long title and slowly resizing the screen. It seems like a bug in the autosizing textarea component we use, one that's exclusive to edge. If you find out more what makes this appear, I'd appreciate you open a ticket with as much info as you can provide. Thanks @StaggerLeee

@StaggerLeee
Copy link

Difficult for me. As CSS only solutions are mostly bad hacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

8 participants