[wp-trac] [WordPress Trac] #59381: Issue with WordPress Year Widget for Years Below 1000

WordPress Trac noreply at wordpress.org
Tue Sep 19 20:10:24 UTC 2023


#59381: Issue with WordPress Year Widget for Years Below 1000
-------------------------------------------------+-------------------------
 Reporter:  idovecer                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch has-testing-info has-    |     Focuses:
  screenshots                                    |
-------------------------------------------------+-------------------------
Changes (by ironprogrammer):

 * keywords:   => needs-patch has-testing-info has-screenshots


Comment:

 Welcome to Trac, @idovecer, and thanks for the report!

 I am able to reproduce this issue with Twenty Twenty-One in the default
 Archives sidebar widget (Figure 1).

 I'm also able to reproduce in Twenty Twenty-Three (block theme) by adding
 the Archive block in the site editor (Figure 2). The following report
 reflects those results.

 == Reproduction Report

 === Steps to Reproduce
 1. With a block theme active, add an Archive block to a page template, set
 it to group by "Year", "Month", or "Day", and save (I used the Single
 template for expediency).
 2. Create or modify a post and set the post date to a year earlier than
 1000.
 3. 👀 Observe that the editor enforces leading zeros for the year (forcing
 `yyyy` format).
 4. Save and view/preview the post on the frontend. If permalinks are
 configured to include the year, 👀 observe that it also includes leading
 zeros in the URL.
 5. 👀 Observe that the Archive block's representation of the year does
 **not** include leading zeros.
 6. 👀 Observe that navigating to the rendered link results in a 404.

 === Environment
 - Hardware: MacBook Pro Apple M1 Pro
 - OS: macOS 13.5.2
 - Browser: Safari 16.6
 - Server: nginx/1.25.2
 - PHP: 7.4.33
 - WordPress: 6.4-alpha-56267-src
 - Theme: twentytwentythree v1.2

 === Actual Results
 - ✅ The Archive block's generated URL does not include leading zeros,
 resulting in a 404 when clicked (reproduced).

 === Supplemental Artifacts
 ''Figure 1:''
 [[Image(https://cldup.com/6nEAtSHPX6.png, 300px)]]

 ''Figure 2:''
 [[Image(https://cldup.com/oFAfAVxjvW.gif)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59381#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list