Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#35709 closed defect (bug) (fixed)

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

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

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 8 years ago.
35709.patch (695 bytes) - added by Ankit K Gupta 8 years ago.
added patch file
35709.1.patch (699 bytes) - added by Ankit K Gupta 8 years ago.
Updated patch file
35709.diff (699 bytes) - added by afercia 7 years ago.

Download all attachments as: .zip

Change History (16)

@antonrinas
8 years ago

#1 @adamsilverstein
8 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
8 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
8 years ago

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

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

@Ankit K Gupta
8 years ago

added patch file

#4 @Ankit K Gupta
8 years ago

  • Keywords has-patch added
  • Version set to 4.4.1

#5 @Ankit K Gupta
8 years ago

Made the string translation ready.

@Ankit K Gupta
8 years ago

Updated patch file

#6 @Ankit K Gupta
8 years ago

  • Keywords needs-refresh added

#7 @Ankit K Gupta
7 years ago

  • Keywords 2nd-opinion added

Can we consider this for fixing in upcoming release ?

#8 @afercia
7 years ago

  • Component changed from Posts, Post Types to Widgets
  • Milestone changed from Awaiting Review to 4.9
  • Owner set to afercia
  • Status changed from new to assigned
  • Version 4.4.1 deleted

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
7 years ago

#9 @afercia
7 years ago

  • Keywords needs-refresh 2nd-opinion removed

Refreshed patch.

#10 @westonruter
7 years ago

  • Keywords commit added
  • Version set to 2.3

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

#11 @afercia
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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
7 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.