WordPress.org

Make WordPress Core

#45402 closed defect (bug) (fixed)

Issues in wp_default_packages_scripts()

Reported by: swissspidy Owned by: youknowriad
Milestone: 5.0 Priority: normal
Severity: minor Version: 5.0
Component: Script Loader Keywords: has-patch commit fixed-5.0
Focuses: Cc:
PR Number:

Description

I noticed two issues in wp_default_packages_scripts() simply by looking at the warnings the IDE threw at me.

First of all, api-fetch is listed twice in $packages_versions.
Second, $scripts->add( $handle, $path, $dependencies, false, $version ); is wrong. $version needs to be the fourth argument. So correct would be $scripts->add( $handle, $path, $dependencies, $version );.

Attachments (4)

45402.diff (885 bytes) - added by swissspidy 11 months ago.
45402.2.diff (1.1 KB) - added by youknowriad 11 months ago.
45402.3.diff (1.1 KB) - added by youknowriad 11 months ago.
45402.4.diff (1.7 KB) - added by youknowriad 11 months ago.

Download all attachments as: .zip

Change History (14)

@swissspidy
11 months ago

#1 @youknowriad
11 months ago

Good catch @swissspidy I updated the patch with the change in the vendors too and I restored the last argument which was inadvertently removed in #45187

Should be good for me.

#2 @youknowriad
11 months ago

wait I have a small typo in the diff (damn keyboard) ;)

#3 @swissspidy
11 months ago

If I'm not mistaken that means all scripts are added to the footer, right? That means the changes made in #45396 are obsolete and would need to be reverted. Otherwise my patch there still applies.

#4 @youknowriad
11 months ago

If I'm not mistaken that means all scripts are added to the footer, right?

Yes, and I think this is something we did a long time ago. I'm fine reverting the other patch here too.

#5 @youknowriad
11 months ago

The last patch includes the revert too.

#6 @pento
11 months ago

  • Keywords commit added

👍🏻 on 45402.4.diff.

#7 @youknowriad
11 months ago

  • Owner set to youknowriad
  • Resolution set to fixed
  • Status changed from new to closed

In 43942:

Block Editor: Fix the WordPress packages and vendor script registration.

The version is set properly and the scripts are automatically loaded in the footer.
This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy.
Fixes #45402.
See #45396.

#8 @youknowriad
11 months ago

  • Keywords fixed-5.0 added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#9 @ocean90
11 months ago

#45396 was marked as a duplicate.

#10 @desrosj
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44277:

Block Editor: Fix the WordPress packages and vendor script registration.

The version is set properly and the scripts are automatically loaded in the footer.

This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy, youknowriad.

Merges [43942] into trunk.

Fixes #45402.
See #45396.

Note: See TracTickets for help on using tickets.