Make WordPress Core

Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#35709 closed defect (bug) (fixed)

Front end: created post with empty title is shown with number instead of title

Reported by: antonrinas Owned by: afercia
Priority: normal Milestone: 4.9
Component: Widgets Version: 2.3
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

STEPS TO REPRODUCE:

  1. Log in as admin.
  2. Go to Add New Post page.
  3. Leave title empty. Fill content with some text. Click "Publish".
  4. Click "View post" in confirmation message.

EXPECTED RESULT:
Post is shown in "Recent posts" without title.
ACTUAL RESULT:
Post is shown in "Recent posts" with number (post ID) instead of empty title (see annex).

Attachments (4)

Front end.jpg (69.4 KB ) - added by antonrinas 11 years ago.
35709.patch (695 bytes ) - added by Ankit K Gupta 11 years ago.
added patch file
35709.1.patch (699 bytes ) - added by Ankit K Gupta 11 years ago.
Updated patch file
35709.diff (699 bytes ) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (16)

@antonrinas
11 years ago

#1 @adamsilverstein
11 years ago

@antonrinas thanks for the bug report.

I don't understand your expected result Post is shown in "Recent posts" without title. - since the recent widget is displaying titles as a list, wouldn't this be a blank list item? Users need to click whatever shows to find the post, I don't think a 'blank' link makes sense!

Showing the post id is confusing, perhaps we could instead show some placeholder text such as '(no title)' which we currently show on the post list page when a post has a blank title? What do you think?

http://cl.ly/1M070R343u02/Posts__test__WordPress_2016-02-03_22-33-26.jpg

#2 @antonrinas
11 years ago

I agree with you. If post has no title and it was published it is better to show it on front end as "(no title)" like it's implemented on back end.

#3 @Ankit K Gupta
11 years ago

Seems (no title) is looking better instead of post id. I agree with @adamsilverstein @antonrinas.
Added patch for the same.

Last edited 11 years ago by Ankit K Gupta (previous) (diff)

@Ankit K Gupta
11 years ago

added patch file

#4 @Ankit K Gupta
11 years ago

  • Keywords has-patch added
  • Version4.4.1

#5 @Ankit K Gupta
11 years ago

Made the string translation ready.

@Ankit K Gupta
11 years ago

Updated patch file

#6 @Ankit K Gupta
10 years ago

  • Keywords needs-refresh added

#7 @Ankit K Gupta
10 years ago

  • Keywords 2nd-opinion added

Can we consider this for fixing in upcoming release ?

#8 @afercia
9 years ago

  • Component Posts, Post TypesWidgets
  • Milestone Awaiting Review4.9
  • Owner set to afercia
  • Status newassigned
  • Version 4.4.1

I've just noticed this while investigating on a related Gutenberg issue and found this ticket. I still can reproduce on trunk, of course. It would be great to use (no title) instead of the ID...

https://cldup.com/zl2rcH2dPP.png

@afercia
9 years ago

#9 @afercia
9 years ago

  • Keywords needs-refresh 2nd-opinion removed

Refreshed patch.

#10 @westonruter
9 years ago

  • Keywords commit added
  • Version2.3

Looks good to me. The ID has been output since WordPress 2.3.

#11 @afercia
9 years ago

  • Resolutionfixed
  • Status assignedclosed

In 41149:

Widgets: make the Recent Posts widget output '(no title)' for posts without a title.

Since WordPress 2.3, the Recent Posts widget used to output the post ID for posts
with an empty title. Using '(no title)' seems a best option and is consistent with
what's already used in other similar cases.

Props antonrinas, Ankit K Gupta.
Fixes #35709.

#12 @Presskopp
9 years ago

You may want to have a look into #39599 (Customizer: when no title on page it adds weird content in navigation link)

Note: See TracTickets for help on using tickets.