Bug 38739 - Templates not ending with include intranet-bottom.inc in staff interface
Summary: Templates not ending with include intranet-bottom.inc in staff interface
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
: 38740 (view as bug list)
Depends on: 37033
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-18 11:33 UTC by Fridolin Somers
Modified: 2026-01-07 13:40 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This update fixes inconsistencies in template markup which could cause duplicated page elements, JavaScript errors, and errors in HTML validation.
Version(s) released in:
26.05.00
Circulation function:


Attachments
Bug 38739: Fix mana-report-search-result.inc (11.22 KB, patch)
2025-10-07 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix admin/file_transports.pl (80.80 KB, patch)
2025-10-07 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix tools/batch_modify_holds.tt (65.27 KB, patch)
2025-10-07 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix some other wrong templates (2.72 KB, patch)
2025-10-07 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix basket/basket.tt (1.00 KB, patch)
2025-10-07 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix mana-report-search-result.inc (11.22 KB, patch)
2025-12-09 09:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix admin/file_transports.pl (80.80 KB, patch)
2025-12-09 09:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix some other wrong templates (2.73 KB, patch)
2025-12-09 09:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix basket/basket.tt (1.01 KB, patch)
2025-12-09 09:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix tools/batch_modify_holds.tt (65.27 KB, patch)
2025-12-09 09:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix mana-report-search-result.inc (11.22 KB, patch)
2025-12-09 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix admin/file_transports.pl (79.69 KB, patch)
2025-12-09 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix some other wrong templates (2.73 KB, patch)
2025-12-09 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix basket/basket.tt (1.01 KB, patch)
2025-12-09 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix tools/batch_modify_holds.tt (65.18 KB, patch)
2025-12-09 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38739: Fix mana-report-search-result.inc (11.27 KB, patch)
2025-12-10 21:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: Fix admin/file_transports.pl (79.74 KB, patch)
2025-12-10 21:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: Fix some other wrong templates (2.77 KB, patch)
2025-12-10 21:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: Fix basket/basket.tt (1.05 KB, patch)
2025-12-10 21:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: Fix tools/batch_modify_holds.tt (65.23 KB, patch)
2025-12-10 21:19 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: (follow-up) Remove extra messages.inc include (978 bytes, patch)
2025-12-10 21:19 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38739: Fix mana-report-search-result.inc (11.32 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 38739: Fix admin/file_transports.pl (79.79 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 38739: Fix some other wrong templates (2.82 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 38739: Fix basket/basket.tt (1.11 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 38739: Fix tools/batch_modify_holds.tt (65.29 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 38739: (follow-up) Remove extra messages.inc include (1.01 KB, patch)
2025-12-30 22:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2024-12-18 11:33:05 UTC
Some templates in staff interface do not end with include intranet-bottom.inc.

 > tail -n1 koha-tmpl/intranet-tmpl/prog/en/modules/*/*.tt | grep -B2 '</html>'

==> koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/downloadcart.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/showelastic.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/showmarc.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/reports/convert_report.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/tools/preview_letter.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt <==
</html>


So for example it does not call hook "intranet_js".

Should all templates end with this include ?
Comment 1 Owen Leonard 2024-12-18 15:38:42 UTC
Popup windows and pages like showmarc.tt which are loaded via AJAX do not need the full contents of intranet-bottom. We would either need to add some logic to intranet-bottom.inc or add a different, trimmed-down version.
Comment 2 Fridolin Somers 2025-09-29 15:57:03 UTC
*** Bug 38740 has been marked as a duplicate of this bug. ***
Comment 3 Fridolin Somers 2025-09-29 16:01:29 UTC
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
calls :
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
That will add ending tags body and html
this must be at the end
Comment 4 Fridolin Somers 2025-10-06 15:06:32 UTC
other suspects :

koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt

> Should all templates end with this include ?
Nope, some blocks may exist after it.
Also there is the example curbside_pickups.tt with :
    [% UNLESS policy.enabled %]
        <div class="alert alert-warning"> Curbside pickups are not enabled for your library. </div>
        [% INCLUDE 'intranet-bottom.inc' %]
        [% STOP %]
    [% END %]
Comment 5 Fridolin Somers 2025-10-06 15:09:00 UTC
Check with :

git grep -A1 "INCLUDE 'intranet-bottom.inc'" | grep -v INCLUDE | grep '</'
Comment 6 Jonathan Druart 2025-10-07 09:05:22 UTC
(In reply to Fridolin Somers from comment #3)
> koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
> calls :
> [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
> That will add ending tags body and html
> this must be at the end

Caused by bug 37033.
Comment 7 Jonathan Druart 2025-10-07 09:32:05 UTC
Created attachment 187506 [details] [review]
Bug 38739: Fix mana-report-search-result.inc
Comment 8 Jonathan Druart 2025-10-07 09:32:07 UTC
Created attachment 187507 [details] [review]
Bug 38739: Fix admin/file_transports.pl
Comment 9 Jonathan Druart 2025-10-07 09:32:10 UTC
Created attachment 187508 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt
Comment 10 Jonathan Druart 2025-10-07 09:32:12 UTC
Created attachment 187509 [details] [review]
Bug 38739: Fix some other wrong templates
Comment 11 Jonathan Druart 2025-10-07 09:32:14 UTC
Created attachment 187510 [details] [review]
Bug 38739: Fix basket/basket.tt
Comment 12 David Nind 2025-12-08 20:33:53 UTC
Not sure how to test this one.

Changed the assignee.

The patches no longer apply 8-(...

git bz apply 38739

Bug 38739 - Templates not ending with include intranet-bottom.inc in staff interface

187506 - Bug 38739: Fix mana-report-search-result.inc
187507 - Bug 38739: Fix admin/file_transports.pl
187508 - Bug 38739: Fix tools/batch_modify_holds.tt
187509 - Bug 38739: Fix some other wrong templates
187510 - Bug 38739: Fix basket/basket.tt

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 38739: Fix mana-report-search-result.inc
Applying: Bug 38739: Fix admin/file_transports.pl
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt
error: Failed to merge in the changes.
Patch failed at 0001 Bug 38739: Fix admin/file_transports.pl
Comment 13 Jonathan Druart 2025-12-09 09:35:53 UTC
Created attachment 190335 [details] [review]
Bug 38739: Fix mana-report-search-result.inc

Patch from commit e55c96c
Comment 14 Jonathan Druart 2025-12-09 09:35:55 UTC
Created attachment 190336 [details] [review]
Bug 38739: Fix admin/file_transports.pl

Patch from commit c017f7a
Comment 15 Jonathan Druart 2025-12-09 09:35:57 UTC
Created attachment 190337 [details] [review]
Bug 38739: Fix some other wrong templates

Patch from commit 5cd3df6
Comment 16 Jonathan Druart 2025-12-09 09:35:58 UTC
Created attachment 190338 [details] [review]
Bug 38739: Fix basket/basket.tt

Patch from commit 3178c9a
Comment 17 Jonathan Druart 2025-12-09 09:35:59 UTC
Created attachment 190339 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt

Patch from commit a52c574
Comment 18 Jonathan Druart 2025-12-09 09:37:16 UTC
Test plan:
Use `git show -w` on the different commit to confirm that:
 * main-container.inc is used to replace the div.main and main tags
 * the extra closing div tag at the end of the files is removed

You can also test the UI and confirm that the sidebar is correctly displayed on the different pages modified by those patches.
Comment 19 Jonathan Druart 2025-12-09 09:41:24 UTC
Created attachment 190340 [details] [review]
Bug 38739: Fix mana-report-search-result.inc

Patch from commit c4c0853
Comment 20 Jonathan Druart 2025-12-09 09:41:25 UTC
Created attachment 190341 [details] [review]
Bug 38739: Fix admin/file_transports.pl

Patch from commit a10f7ee
Comment 21 Jonathan Druart 2025-12-09 09:41:27 UTC
Created attachment 190342 [details] [review]
Bug 38739: Fix some other wrong templates

Patch from commit 7c8466c
Comment 22 Jonathan Druart 2025-12-09 09:41:28 UTC
Created attachment 190343 [details] [review]
Bug 38739: Fix basket/basket.tt

Patch from commit dd70679
Comment 23 Jonathan Druart 2025-12-09 09:41:30 UTC
Created attachment 190344 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt

Patch from commit 27ac86a
Comment 24 Owen Leonard 2025-12-10 21:18:50 UTC
Created attachment 190421 [details] [review]
Bug 38739: Fix mana-report-search-result.inc

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 25 Owen Leonard 2025-12-10 21:18:53 UTC
Created attachment 190422 [details] [review]
Bug 38739: Fix admin/file_transports.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 26 Owen Leonard 2025-12-10 21:18:56 UTC
Created attachment 190423 [details] [review]
Bug 38739: Fix some other wrong templates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 27 Owen Leonard 2025-12-10 21:18:59 UTC
Created attachment 190424 [details] [review]
Bug 38739: Fix basket/basket.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 28 Owen Leonard 2025-12-10 21:19:02 UTC
Created attachment 190425 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 29 Owen Leonard 2025-12-10 21:19:05 UTC
Created attachment 190426 [details] [review]
Bug 38739: (follow-up) Remove extra messages.inc include

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 30 Victor Grousset/tuxayo 2025-12-30 22:00:05 UTC
Created attachment 190780 [details] [review]
Bug 38739: Fix mana-report-search-result.inc

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 31 Victor Grousset/tuxayo 2025-12-30 22:00:08 UTC
Created attachment 190781 [details] [review]
Bug 38739: Fix admin/file_transports.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 32 Victor Grousset/tuxayo 2025-12-30 22:00:10 UTC
Created attachment 190782 [details] [review]
Bug 38739: Fix some other wrong templates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 33 Victor Grousset/tuxayo 2025-12-30 22:00:13 UTC
Created attachment 190783 [details] [review]
Bug 38739: Fix basket/basket.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 34 Victor Grousset/tuxayo 2025-12-30 22:00:16 UTC
Created attachment 190784 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 35 Victor Grousset/tuxayo 2025-12-30 22:00:18 UTC
Created attachment 190785 [details] [review]
Bug 38739: (follow-up) Remove extra messages.inc include

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 36 Victor Grousset/tuxayo 2025-12-30 22:02:50 UTC
I've been going at the changed pages and doing a diff before and after the patches on
- the final HTML in the inspector (after eventual JS does it's stuff, but the browser will fix some stuff like stray tags)
- the HTTP response

And also comparing the HTMLs results the W3C validator.

The changes are great, in hold-group.tt, on main, the cookieConsentBar was duplicated :o In the final html in the inspector, it is also present in the holds group modal.
It was invisible but still, it was there and duplicated. So now it's fixed.

audio-alert was also duplicated.

Overall on the pages, several unclosed <div> are fixed. I think also some other tags that were stray.


Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 37 Lucas Gass (lukeg) 2026-01-06 14:33:57 UTC
Nice work everyone!

Pushed to main for 26.05