Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / js / system.js
index d62cc074463047a548313c1de6595941a0f0b7be..f23a69a93714b4ca175a739387a283551f052f57 100644 (file)
 
   Drupal.behaviors.copyFieldValue = {
     attach: function attach(context) {
-      for (var sourceId in drupalSettings.copyFieldValue) {
-        if (drupalSettings.copyFieldValue.hasOwnProperty(sourceId)) {
-          ids.push(sourceId);
-        }
-      }
+      Object.keys(drupalSettings.copyFieldValue || {}).forEach(function (element) {
+        ids.push(element);
+      });
+
       if (ids.length) {
         $('body').once('copy-field-values').on('value:copy', this.valueTargetCopyHandler);