[wp-trac] [WordPress Trac] #53566: Pass the asset path to the `_doing_it_wrong()` notice in `register_block_script_handle()`

WordPress Trac noreply at wordpress.org
Wed Feb 1 17:28:44 UTC 2023


#53566: Pass the asset path to the `_doing_it_wrong()` notice in
`register_block_script_handle()`
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.2
Component:  Script Loader                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:
  testing changes-requested                      |
-------------------------------------------------+-------------------------

Comment (by desrosj):

 I've done some testing on this and left a review on the pull request.
 Mentioning some of the feedback here for reference as well.

 It appears my initial suggestion to use a `false === $script_asset_path`
 comparison was incorrect. While `realpath()` returns explicit `false` when
 a file does not exist, `wp_normalize_path()` will return an empty string
 when passed `false`. Seems an `empty()` check would be more appropriate.

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


More information about the wp-trac mailing list