Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / tracker / js / tracker-history.es6.js
index 5df3494a9cd263a2895b66e13c5872ee9cc29334..13090008d65e663550408c120c488e0c8db3971c 100644 (file)
       data: { 'node_ids[]': nodeIDs },
       dataType: 'json',
       success(results) {
-        for (const nodeID in results) {
-          if (results.hasOwnProperty(nodeID) && placeholdersToUpdate.hasOwnProperty(nodeID)) {
+        Object.keys(results || {}).forEach((nodeID) => {
+          if (placeholdersToUpdate.hasOwnProperty(nodeID)) {
             const url = results[nodeID].first_new_comment_link;
             const text = Drupal.formatPlural(results[nodeID].new_comment_count, '1 new', '@count new');
             $(placeholdersToUpdate[nodeID]).append(`<br /><a href="${url}">${text}</a>`);
           }
-        }
+        });
       },
     });
   }