Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rf05bf757516a9b4b8170462f9de833767fa71c5a -rb1b465cd37bae4ef2732ec23e4061467c22bdd35 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision f05bf757516a9b4b8170462f9de833767fa71c5a) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision b1b465cd37bae4ef2732ec23e4061467c22bdd35) @@ -192,8 +192,12 @@ allGroup.data('templates', allTemplates); $.each(learningLibraryGroups, function(){ - var templates = allTemplates.clone().appendTo(templateContainerCell), - learningLibraries = this.learningLibraries; + var learningLibraries = this.learningLibraries; + if (!learningLibraries) { + return true; + } + + var templates = allTemplates.clone().appendTo(templateContainerCell); // cloned everything, now remove ones that are not in the list $('.template', templates).each(function(){ var learningLibraryId = $(this).attr('learningLibraryId'),