Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#55503 new defect (bug)

Post Date display issue if we set empty from General Settings page

Reported by: rishishah's profile rishishah Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Date/Time Keywords:
Focuses: administration Cc:

Description

Hello,

I have faced one issue with the post date field on the backend side.

If we set empty Date and Time format from the General Settings page then the post date will be empty displaying on the edit screen of an article(any post type).
We need to set any default date and time format to display or make the Date format and Time format field required. If any admin set it empty mistakenly then it will take hours to figure out the root cause of the issue.

Attachments (3)

post date bug.jpg (543.9 KB) - added by rishishah 2 years ago.
55503.patch (1.0 KB) - added by rishishah 2 years ago.
Applied patch to add default value if anyone kept blank Date and Time format field.
55503.1.patch (973 bytes) - added by jariwalasagar 2 years ago.
Instead of add static Date/Time format, We can use previous stored data if custom formats are null.

Download all attachments as: .zip

Change History (5)

@rishishah
2 years ago

Applied patch to add default value if anyone kept blank Date and Time format field.

#1 @SergeyBiryukov
2 years ago

  • Component changed from Administration to Date/Time

#2 @Rarst
2 years ago

Technically empty string is a valid date format. I would be wary of introducing a special case for it, given it is long established feature and upstream PHP functions do not act like that.

Also I am not sure anyone in the wild uses it to blank output purposely, but can't be sure they are not either.

@jariwalasagar
2 years ago

Instead of add static Date/Time format, We can use previous stored data if custom formats are null.

Note: See TracTickets for help on using tickets.