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