[wp-trac] [WordPress Trac] #53566: Include the asset path to the `_doing_it_wrong()` notice in `register_block_script_handle()`
WordPress Trac
noreply at wordpress.org
Wed Jun 30 19:32:53 UTC 2021
#53566: Include 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: Awaiting Review
Component: Script Loader | Version:
Severity: normal | Keywords: good-first-bug
Focuses: |
---------------------------+-----------------------------
The `_doing_it_wrong()` notice in `register_block_script_handle()`
provides the metadata field name and block name when the requested asset
does not exist, but not the path of where the asset is expected to be.
Adding the value passed to `realpath()` could be helpful to debug why the
file is considered non-existent.
Also, the conditional surrounding the `_doing_it_wrong()` notice is a `!
file_exists()` check. However, the path used to check for the file is
passed through `realpath()` before, which will be `false` if the file does
not exist. The `file_exists()` check could be removed in favor of a `false
!== $script_asset_path` check.
Related #53565.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53566>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list