Opened 8 years ago
Last modified 7 years ago
#38052 new defect (bug)
wp-utility.js misses function argument null
Reported by: | wiardvanrij | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 4.6 |
Component: | General | Keywords: | has-patch needs-unit-tests needs-testing |
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 (7)
This ticket was mentioned in Slack in #slackhelp by dewinter. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by dewinter. View the logs.
8 years ago
#5
@
8 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
@
7 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.
This was introduced in #36695