[wp-trac] [WordPress Trac] #33330: Undefined property: stdClass::$slug

WordPress Trac noreply at wordpress.org
Thu Aug 3 21:00:22 UTC 2023


#33330: Undefined property: stdClass::$slug
-------------------------------------------------+-------------------------
 Reporter:  mattfiocca                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Plugins                              |     Version:  4.0
 Severity:  minor                                |  Resolution:  fixed
 Keywords:  2nd-opinion has-screenshots php80    |     Focuses:
  needs-unit-tests                               |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:39 sc0ttkclark]:
 > This appears to have been solved in May 2021 as part of [50921].
 >
 > The new code does an isset() check, but it does not throw a
 _doing_it_wrong notice.
 >
 > I'm unsure if effort should be made to throw a _doing_it_wrong at this
 point, it would have already been fixed by any active plugin that had a
 problem.
 >
 > I suggest marking this ticket as fixed via [50921] (leaving this to @jrf
 to confirm)

 Good catch @sc0ttkclark! Yes, I agree this ticket can be closed as fixed
 via [50921].

 However, the fix hides why the code is being skipped. As @jrf noted, the
 original notice/warning was informational to alert developers of a problem
 in their code.

 >As for the solution:
 >This should preferably be solved in whichever plugin is causing the
 issue.

 >As for the patch:
 >In my opinion, as I stated above, if a patch should be accepted at all,
 the trigger_error() should be changed to a `_doing_it_wrong()` and I think
 the break will probably need to change to a continue (needs
 testing/further review).

 As a follow-up to [50921], I'll open a new ticket for adding a
 `_doing_it_wrong()` and tests. On my TODO list.

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


More information about the wp-trac mailing list