Bug 22303 - Wrong bottom in virtualshelves/addbybiblionumber.tt
Summary: Wrong bottom in virtualshelves/addbybiblionumber.tt
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Owen Leonard
QA Contact: Josef Moravec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-11 08:52 UTC by Fridolin SOMERS
Modified: 2019-05-27 12:34 UTC (History)
6 users (show)

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


Attachments
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt (1.93 KB, patch)
2019-02-11 16:03 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt (1.90 KB, patch)
2019-02-28 16:24 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt (1.96 KB, patch)
2019-03-01 22:03 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt (2.01 KB, patch)
2019-03-05 17:15 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2019-02-11 08:52:30 UTC
In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.
It should be last line and use popup-bottom.inc.
Comment 1 Fridolin SOMERS 2019-02-11 16:03:38 UTC
Created attachment 84981 [details] [review]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt

In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>
Comment 2 Owen Leonard 2019-02-11 16:37:12 UTC
It looks to me like the problem is that the template only includes intranet-bottom.inc if the user is authorized to add to the list. I think the correct solution is to move these lines:

[% SET popup_window = 1 %]
[% INCLUDE 'intranet-bottom.inc' %]

...to the end of the template, after the last [% END %]
Comment 3 Fridolin SOMERS 2019-02-12 14:40:03 UTC
(In reply to Owen Leonard from comment #2)
> It looks to me like the problem is that the template only includes
> intranet-bottom.inc if the user is authorized to add to the list. I think
> the correct solution is to move these lines:
> 
> [% SET popup_window = 1 %]
> [% INCLUDE 'intranet-bottom.inc' %]
> 
> ...to the end of the template, after the last [% END %]

But it is a popup, why not using popup-bottom.inc ?
Comment 4 Fridolin SOMERS 2019-02-28 16:24:32 UTC
(In reply to Fridolin SOMERS from comment #3)
> (In reply to Owen Leonard from comment #2)
> > It looks to me like the problem is that the template only includes
> > intranet-bottom.inc if the user is authorized to add to the list. I think
> > the correct solution is to move these lines:
> > 
> > [% SET popup_window = 1 %]
> > [% INCLUDE 'intranet-bottom.inc' %]
> > 
> > ...to the end of the template, after the last [% END %]
> 
> But it is a popup, why not using popup-bottom.inc ?

OK not important ;)
Comment 5 Fridolin SOMERS 2019-02-28 16:24:53 UTC
Created attachment 85882 [details] [review]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt

In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>
Comment 6 Maryse Simard 2019-03-01 22:03:17 UTC
Created attachment 85924 [details] [review]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt

In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 7 Josef Moravec 2019-03-05 17:15:15 UTC
Created attachment 86107 [details] [review]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt

In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Nick Clemens 2019-03-07 21:21:30 UTC
Awesome work all!

Pushed to master for 19.05
Comment 9 Martin Renvoize 2019-03-12 08:48:07 UTC
Pushed to 18.11.x for 18.11.04
Comment 10 Lucas Gass 2019-03-15 17:24:22 UTC
backported to 18.05.x for 18.05.11