Resources tool's "add details" link and missing "delete" button when adding multiple folders and links from the Home tab

Description

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"

  • Check Mark A new row will appear to allow you to create another item

  • Cross Mark Try clicking on the "Add details for this item" link for the NEW row... nothing happens

  • Cross Mark the delete button is not rendered

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)

Attachments

1
  • 14 Feb 2018, 07:59 PM

Activity

Austin July 18, 2018 at 2:01 PM

Matthew Jones July 18, 2018 at 9:39 AM

Can you submit this patch as a PR for master?

Austin February 14, 2018 at 8:07 PM
Edited

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

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created February 13, 2018 at 8:19 PM
Updated July 25, 2018 at 11:13 AM
Resolved July 25, 2018 at 11:13 AM

Flag notifications