Opened 10 years ago
Last modified 2 months ago
#38052 new defect (bug)
wp-utility.js misses function argument null
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | major | Version: | 4.6 |
| Component: | General | Keywords: | has-patch needs-unit-tests needs-refresh |
| Focuses: | javascript | Cc: |
Description
Since 4.6 the wp-utility is updated. The null parameter has been removed here:
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
to
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options );
Which can give the following error:
wp-util.min.js:1 Uncaught TypeError: (intermediate value)(intermediate value) is not a function
This is fixed by adding that null value again like this:
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
Affects version 4.6 and 4.6.1
Attachments (1)
Change History (8)
This ticket was mentioned in Slack in #slackhelp by dewinter. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by dewinter. View the logs.
9 years ago
#5
@
9 years ago
- Keywords has-patch needs-unit-tests needs-testing added; needs-patch removed
Just added a patch to bring back the null in the _.template call. Per #36695 this was removed to update _.template to the most current syntax - so this will need tested fairly thoroughly to make sure we aren't fixing one issue to create another.
#6
@
9 years ago
Some info that might help. I'm working on a plugin which bundles( with webpack) a NPM package with a Lodash 2.x.x dependency. Now when this script is enqueued in the admin dashboard somehow _.template inherits the old behavior and this error is triggered when I try the Add Media button or any other modal.
#7
@
2 months ago
- Keywords needs-refresh added; needs-testing removed
I attempted to apply the available patch against current trunk (7.0-alpha-61215-src), but it could not be applied.
The patch references wp-util.js.patch, however the file could not be found and the patch task failed to run. Because of this, the patch cannot be tested.
It appears the patch/attachment is outdated or incorrectly structured. Marking this as needs-refresh and removing needs-testing until a working patch is provided.
This was introduced in #36695