-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Restore original return value for WP_Script_Modules::get_dependencies()
#10403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore original return value for WP_Script_Modules::get_dependencies()
#10403
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
An initial test of this PR applied to 6.9-beta1 seems to resolve the problem I reported in https://core.trac.wordpress.org/ticket/61734#comment:52. I'll test some more tomorrow. |
|
After further review, this PR looks good. Doesn't result in a fatal for QM and still provides the the extra |
…get_dependencies()`. Even though this method is private, there are some usages of it in the ecosystem via the Reflection API. So this reverts the script module IDs `string[]` return value in favor of the original `array<string, array>` return value. This re-emphasizes the need for more public accessor methods being tracked in #60597. Developed in #10403 Follow-up to [60999]. Props pbiron, westonruter, johnbillion. See #63486, #60597. git-svn-id: https://develop.svn.wordpress.org/trunk@61073 602fd350-edb4-49c9-b593-d223f7449a82
…get_dependencies()`. Even though this method is private, there are some usages of it in the ecosystem via the Reflection API. So this reverts the script module IDs `string[]` return value in favor of the original `array<string, array>` return value. This re-emphasizes the need for more public accessor methods being tracked in #60597. Developed in WordPress/wordpress-develop#10403 Follow-up to [60999]. Props pbiron, westonruter, johnbillion. See #63486, #60597. Built from https://develop.svn.wordpress.org/trunk@61073 git-svn-id: http://core.svn.wordpress.org/trunk@60409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
Committed in r61073. |
…get_dependencies()`. Even though this method is private, there are some usages of it in the ecosystem via the Reflection API. So this reverts the script module IDs `string[]` return value in favor of the original `array<string, array>` return value. This re-emphasizes the need for more public accessor methods being tracked in #60597. Developed in WordPress/wordpress-develop#10403 Follow-up to [60999]. Props pbiron, westonruter, johnbillion. See #63486, #60597. Built from https://develop.svn.wordpress.org/trunk@61073 git-svn-id: https://core.svn.wordpress.org/trunk@60409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See https://core.trac.wordpress.org/ticket/61734#comment:55
This reverts the
WP_Script_Modules::get_dependencies()change in 25420f0 which was developed in #9867 to fix Core-63486.As of WP 6.8,
WP_Script_Modules::get_dependencies()had this return signature:wordpress-develop/src/wp-includes/class-wp-script-modules.php
Line 306 in 58edb2f
The aforementioned commit for 6.9 changed it to:
wordpress-develop/src/wp-includes/class-wp-script-modules.php
Line 569 in 7a840d3
Since the method was private, I didn't think there would be a problem to make this change. However, it turns out that Query Monitor is using this private method via the Reflection API. This is because core is not yet exposing the necessary accessor methods from
WP_Script_Modules, and so QM is forced to use a private method. This is something which should be no longer be necessary as of Core-60597.In the meantime, we can restore the original return value for the method since it isn't particularly difficult to do so for 6.9-beta2.
Trac ticket: https://core.trac.wordpress.org/ticket/61734
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.