Bug 28407 - CollapseFieldsPatronAddForm creates problems with hidden elements in Patron restrictions
Summary: CollapseFieldsPatronAddForm creates problems with hidden elements in Patron r...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-20 19:13 UTC by Christopher Brannon
Modified: 2021-05-24 15:06 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2021-05-20 19:13:35 UTC
If you use CollapseFieldsPatronAddForm to collapse Patron restrictions, it will cause hidden elements within to be out of sync.  I've used the following to compensate for this flaw:

    //Fix expanded restriction form with nested collapsed section
    $('#pat_memberentrygen #memberentry_restrictions').wrapInner('<div id="restrictionContainer" style="display:none;"></div>');
    $('#pat_memberentrygen #restrictionContainer').children().show();
    $('#pat_memberentrygen #manual_restriction_form').children().show();
    $('#pat_memberentrygen #memberentry_restrictions').prepend($('#restrictions_lgd'));
    $('#pat_memberentrygen #manual_restriction_form').hide();
Comment 1 Katrin Fischer 2021-05-24 11:22:01 UTC
Can you explain what is meant by "out of sync" and maybe add a step by step on how to see the issue fixed by the jQuery?
Comment 2 Christopher Brannon 2021-05-24 15:06:05 UTC
1. Set Patron restrictions as one of the collapsed fields in CollapseFieldsPatronAddForm.
2. Edit a patron.
3. Patron restrictions is collapsed.  Click on it to open it.
4. See that the empty Add manual restriction legend shows below the link to Add manual restriction.  This area should not show until the link is clicked.
5. Click the link.  The link disappears.
6. Click the legend.  The content appears.
7. Click cancel.  The legend and content disappear as expected.
8. Click the Patron restriction legend.  That section collapses, but the Add manual restriction legend and contents show.

The Add manual restriction legend should not be showing, and should not be acting like the other legends.  It should be hidden until the link is clicked, and it should be hidden when cancel is clicked.  It should not be acting like the parent, and as is, and depending on the state it is in (showing or hidden), is out of sync with the parent.