Bug 38711 - Wrong font-weight in tables during printing from staff interface
Summary: Wrong font-weight in tables during printing from staff interface
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Alexander Wagner
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-16 09:37 UTC by Alexander Wagner
Modified: 2025-03-19 23:01 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the print style sheet for tables in the staff interface - the last column is no longer printed in bold. This was affecting various pages when printed, such as notices and slips, and pages.
Version(s) released in:
25.05.00,24.11.03
Circulation function:


Attachments
Bug 38711: Wrong font-weight in tables during printing from STAFF interface (1.57 KB, patch)
2024-12-17 10:21 UTC, Alexander Wagner
Details | Diff | Splinter Review
Bug 38711: Wrong font-weight in tables during printing from STAFF interface (1.61 KB, patch)
2024-12-22 22:27 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Wagner 2024-12-16 09:37:58 UTC
While printing a page from the Koha STAFF interface all last columns of tables use **bold** font while on screen they use normal font.

This can be seen e.g. when running reports to feed a notice.

This happens due to the following CSS defined for _print_:

```
td:last-child,
th:last-child {
    background-color: #E9E9E9;
    border-bottom: 1px solid #CCCCCC;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    font-size: 14px;
    font-weight: bold;
    padding: 5px 5px 5px 5px;
}
```

This assigns `font-weight: bold` to all `last-child`s of `td`.
Comment 1 Alexander Wagner 2024-12-16 10:37:29 UTC
The easiest way to reproduce is a custom html page that holds a real table.

1. Go to `Home / Tools / Additional content / Pages`
2. Select `Add new entry using text editor`
3. Add the following html

```html
<table>
   <tbody>
      <tr>
         <td>col 11</td>
         <td>col 12</td>
      </tr>
      <tr>
         <td>col 21</td>
         <td>col 22</td>
      </tr>
</tbody>
</table>
```

4. Save
5. Use the `Staff`-URL from `Additional content: Pages` to open the page in a new tab
6. Select `File / Print` (or fire up the dev console and apply the Print-css)
7. The entries `col 12` and `col 22` appear in bold face.
Comment 2 Alexander Wagner 2024-12-17 10:21:04 UTC
Created attachment 175603 [details] [review]
Bug 38711: Wrong font-weight in tables during printing from STAFF interface

Fix last columns of tables to be printed in `bold`. This affects
various functions of Koha e.g. Notices and Slips, Pages etc.

1. Go to `Home / Tools / Additional content / Pages`
2. Select `Add new entry using text editor`
3. Add the following html

```html
<table>
   <tbody>
      <tr>
         <td>col 11</td>
         <td>col 12</td>
      </tr>
      <tr>
         <td>col 21</td>
         <td>col 22</td>
      </tr>
</tbody>
</table>
```

4. Save
5. Use the `Staff`-URL from `Additional content: Pages`
   to open the page in a new tab
6. Select `File / Print`
   (or fire up the dev console via F12 and apply the Print-css)
7. The entries `col 12` and `col 22` appear in bold face.
8. Apply the patch
9. Reload the page
10. The entries `col 12` and `col 22` appear in normal font.

Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library
Comment 3 David Nind 2024-12-22 22:27:17 UTC
Created attachment 175907 [details] [review]
Bug 38711: Wrong font-weight in tables during printing from STAFF interface

Fix last columns of tables to be printed in `bold`. This affects
various functions of Koha e.g. Notices and Slips, Pages etc.

1. Go to `Home / Tools / Additional content / Pages`
2. Select `Add new entry using text editor`
3. Add the following html

```html
<table>
   <tbody>
      <tr>
         <td>col 11</td>
         <td>col 12</td>
      </tr>
      <tr>
         <td>col 21</td>
         <td>col 22</td>
      </tr>
</tbody>
</table>
```

4. Save
5. Use the `Staff`-URL from `Additional content: Pages`
   to open the page in a new tab
6. Select `File / Print`
   (or fire up the dev console via F12 and apply the Print-css)
7. The entries `col 12` and `col 22` appear in bold face.
8. Apply the patch
9. Reload the page
10. The entries `col 12` and `col 22` appear in normal font.

Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2024-12-27 15:34:42 UTC
QA by RM
Comment 5 Katrin Fischer 2024-12-27 16:36:48 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Paul Derscheid 2025-03-19 23:01:37 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.03