In core/modules/field_ui/field_ui.js we currently have this:

 120         // Create the row handler, make it accessible from the DOM row element.
 121         var rowHandler = eval('new rowHandlers.' + data.rowHandler + '(row, data);');
 122         $(row).data('fieldUIRowHandler', rowHandler);

I see no reason for using eval() here. Simple bracket notation is enough and looks cleaner.

 120         // Create the row handler, make it accessible from the DOM row element.
 121         var rowHandler = new rowHandlers[data.rowHandler](row, data);
 122         $(row).data('fieldUIRowHandler', rowHandler);

Comments

Status: Needs review » Needs work

The last submitted patch, field_ui-eval.patch, failed testing.

twod’s picture

Status: Needs work » Needs review
StatusFileSize
new571 bytes

Forgot the bot runs with that switch....

robloach’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new591 bytes

Yup! Updated with the new /core structure here, other than that, good to go.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks folks, committed/pushed to 8.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nburles’s picture

Status: Closed (fixed) » Needs review
Issue tags: +backport
StatusFileSize
new571 bytes

Will it be possible for this to be applied to Drupal 7 as well?

I am working on a module that uses hook_js_alter() to replace the core JS with minified alternatives (of the correct version).

Minifying field_ui.js (with munging enabled), however, breaks it due to this use of eval().

I've attached a patch that applies against the current 7.x.

Thanks,
Nathan

Status: Needs review » Needs work

The last submitted patch, fielduijs_allow_minification-1273104-6.patch, failed testing.

nod_’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: -backport

add backport tag

nod_’s picture

Status: Needs work » Needs review
StatusFileSize
new571 bytes
robloach’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Seems reasonable to me. :)

Committed and pushed to 7.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Small compensation for new /core structure.