Resources tool's "add details" link and missing "delete" button when adding multiple folders and links from the Home tab
GENERAL
TESTING
GENERAL
TESTING
Description
Attachments
1
- 14 Feb 2018, 07:59 PM
relates to
Activity
Austin July 18, 2018 at 2:01 PM
@Matthew Jones, I've created https://github.com/sakaiproject/sakai/pull/5808
Matthew Jones July 18, 2018 at 9:39 AM
@Austin Can you submit this patch as a PR for master?
Austin February 14, 2018 at 8:07 PMEdited
I believe the JS error, which causes the 'add details' and 'delete' buttons to not appear, and fails on these lines:
sakai_properties_scripts.vm
document.getElementById('releaseDatePicker${DOT}'+index).classList.remove('hasDatepicker');
document.getElementById('retractDatePicker${DOT}'+index).classList.remove('hasDatepicker');
was happening because when on the 'Home' tab, the 'add details' section does not render any datePickers. So checking for null in the setupDatePickers() function should fix the JS error and make the "add details" and "delete" buttons appear.
I've supplied a patch for Sakai 11.4:
which is a modification of part of the patch from https://sakaiproject.atlassian.net/browse/SAK-31520#icft=SAK-31520
Steps:
log in as a non-admin user
From the Home tab
Open the Resources Tool
Right click on Actions and select Create Folder or Web Links
Click on "Add another folder" or "Add another link"
This problem only seems to happen when adding more folders / links from the "Home" tab
It does not happen when doing so from a "Site" tab
Also, I suspect the problem is happening because when you click "Add another folder" a JS error occurs:
sakai.resource.type.helper.helper:7880 Uncaught TypeError: Cannot read property 'classList' of null at setupDatePickers (sakai.resource.type.helper.helper:7880) at addFileInput (sakai.resource.type.helper.helper:8169) at HTMLAnchorElement.onclick (sakai.resource.type.helper.helper:7713)