[wp-trac] [WordPress Trac] #45513: Notice: Undefined index: year

WordPress Trac noreply at wordpress.org
Mon Aug 8 14:38:22 UTC 2022


#45513: Notice: Undefined index: year
-------------------------------------------------+-------------------------
 Reporter:  1naveengiri                          |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Permalinks                           |     Version:  5.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots needs-testing dev-   |     Focuses:
  feedback has-patch needs-unit-tests            |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"53861" 53861]:
 {{{
 #!CommitTicketReference repository="" revision="53861"
 Tests: Improve the test for not throwing a warning on malformed date
 queries.

 * Make it specifically about `wp_resolve_numeric_slug_conflicts()`, the
 function that was throwing an `Undefined array key "year"` PHP warning for
 malformed date requests.
 * Move the test under the `rewrite` component and make its name a bit more
 descriptive.
 * Check the return result of the function instead of performing a dummy
 assertion.
 * Use named array keys in the data provider for clarity.
 * Add missing `@covers` tag.

 Follow-up to [32648], [53857].

 Props costdev, peterwilsoncc, 1naveengiri, mukesh27, SergeyBiryukov.
 See #52252, #45513.
 }}}

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


More information about the wp-trac mailing list