Bug 23905 - Button "Search to add" doesn't work on Quick add new patron
Summary: Button "Search to add" doesn't work on Quick add new patron
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on: 23778 14570
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-27 13:53 UTC by Michal Denar
Modified: 2019-11-26 11:49 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00


Attachments
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (991 bytes, patch)
2019-11-25 16:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (4.43 KB, patch)
2019-11-25 17:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (5.44 KB, patch)
2019-11-25 17:50 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (5.86 KB, patch)
2019-11-25 18:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (5.93 KB, patch)
2019-11-26 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23905: Remove extra closing span (1.04 KB, patch)
2019-11-26 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23905: Button "Search to add" doesn't work on Quick add new patron (5.97 KB, patch)
2019-11-26 11:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 23905: Remove extra closing span (1.11 KB, patch)
2019-11-26 11:16 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Denar 2019-10-27 13:53:07 UTC
In current master button "Search to add" in Quick add ne patron page don't open search window.
Comment 1 Katrin Fischer 2019-11-24 13:27:09 UTC
Tested and confirmed on master - you can no longer add guarantors from the quick add form.
Comment 2 Jonathan Druart 2019-11-25 15:22:38 UTC
I think it has been caused by
  commit bc9871f428af323901ebe57a6d0888f1dcf871cf
  Bug 23778: Regression: Guarantor entry section no longer has a unique id
Comment 3 Jonathan Druart 2019-11-25 15:29:27 UTC
But I think it's also broken since bug 14570.

This must be fixed for 19.11.
Comment 4 Kyle M Hall 2019-11-25 16:51:00 UTC
Created attachment 95798 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron
Comment 5 Kyle M Hall 2019-11-25 16:53:03 UTC
This fixes the popup not showing, but after selecting a patron, the info is not added to the page.

the line:
$('#guarantor_relationships').append( fieldset );
simply does nothing. If you add it to something outside of #guarantor_relationships such as 'body' or '#quick_add_form' it shows up! I'm not sure why it refused to append to '#guarantor_relationships'.
Comment 6 Kyle M Hall 2019-11-25 16:53:38 UTC
I have a hunch that it has to do with these elements not existing at the time the page is loaded. These elements are created dynamically via javascript, right?
Comment 7 Kyle M Hall 2019-11-25 16:54:40 UTC
In addition, I just realized the guarantor 'template' is visible on the quick add form, but should not be.
Comment 8 Katrin Fischer 2019-11-25 17:02:27 UTC
(In reply to Kyle M Hall from comment #7)
> In addition, I just realized the guarantor 'template' is visible on the
> quick add form, but should not be.

Are we sure about that? I was wondering too, but there is a note referring quick add and guarantor:

Note: Quick add guarantor form populates address fields in full form
Comment 9 Kyle M Hall 2019-11-25 17:33:56 UTC
Created attachment 95800 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron
Comment 10 Kyle M Hall 2019-11-25 17:50:51 UTC
Created attachment 95803 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron

This issue is caused by duplicating the patron guarantor fieldset.
The solution is to move it between the two forms insetad.
In addition, this patch moves the guarantor information fieldset to the area below the "Quick add" fieldset, instead of *inside* it. This change preserves the correct styling and layout of the Guarantor information fieldset whilst it is moved back and forth by the "quick add"/"full form" toggle.

Test Plan:
1) Quick add a child patron
2) Attempt to use the "Search to add" button
3) Note it does nothing
4) Apply this patch
5) Repeat steps 1 and 2
6) It works now!
7) Test toggling between the quick add and full form views,
   note the "Guarantor information" fieldset shows correctly
   in the full form view.
Comment 11 Kyle M Hall 2019-11-25 18:01:51 UTC
Created attachment 95804 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron

This issue is caused by duplicating the patron guarantor fieldset.
The solution is to move it between the two forms insetad.
In addition, this patch moves the guarantor information fieldset to the area below the "Quick add" fieldset, instead of *inside* it. This change preserves the correct styling and layout of the Guarantor information fieldset whilst it is moved back and forth by the "quick add"/"full form" toggle.

Test Plan:
1) Quick add a child patron
2) Attempt to use the "Search to add" button
3) Note it does nothing
4) Apply this patch
5) Repeat steps 1 and 2
6) It works now!
7) Test toggling between the quick add and full form views,
   note the "Guarantor information" fieldset shows correctly
   in the full form view.
Comment 12 Jonathan Druart 2019-11-26 09:32:30 UTC
Created attachment 95812 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron

This issue is caused by duplicating the patron guarantor fieldset.
The solution is to move it between the two forms insetad.
In addition, this patch moves the guarantor information fieldset to the area below the "Quick add" fieldset, instead of *inside* it. This change preserves the correct styling and layout of the Guarantor information fieldset whilst it is moved back and forth by the "quick add"/"full form" toggle.

Test Plan:
1) Quick add a child patron
2) Attempt to use the "Search to add" button
3) Note it does nothing
4) Apply this patch
5) Repeat steps 1 and 2
6) It works now!
7) Test toggling between the quick add and full form views,
   note the "Guarantor information" fieldset shows correctly
   in the full form view.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2019-11-26 09:32:34 UTC
Created attachment 95813 [details] [review]
Bug 23905: Remove extra closing span

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Martin Renvoize 2019-11-26 11:16:28 UTC
Created attachment 95818 [details] [review]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron

This issue is caused by duplicating the patron guarantor fieldset.
The solution is to move it between the two forms insetad.
In addition, this patch moves the guarantor information fieldset to the area below the "Quick add" fieldset, instead of *inside* it. This change preserves the correct styling and layout of the Guarantor information fieldset whilst it is moved back and forth by the "quick add"/"full form" toggle.

Test Plan:
1) Quick add a child patron
2) Attempt to use the "Search to add" button
3) Note it does nothing
4) Apply this patch
5) Repeat steps 1 and 2
6) It works now!
7) Test toggling between the quick add and full form views,
   note the "Guarantor information" fieldset shows correctly
   in the full form view.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize 2019-11-26 11:16:32 UTC
Created attachment 95819 [details] [review]
Bug 23905: Remove extra closing span

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 16 Martin Renvoize 2019-11-26 11:16:54 UTC
Looks good to me, thanks guys.. PQA and Pushing.
Comment 17 Martin Renvoize 2019-11-26 11:17:15 UTC
Nice work!

Pushed to master for 19.11.00