Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringGeneral.js,v diff -u -r1.76 -r1.77 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 5 Jul 2016 07:38:08 -0000 1.76 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 15 Jul 2016 06:15:56 -0000 1.77 @@ -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'),