Bug 33622 - Notice content does not show on default tab if TranslateNotices enabled
Summary: Notice content does not show on default tab if TranslateNotices enabled
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate
Depends on: 32912
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-27 01:06 UTC by Aleisha Amohia
Modified: 2023-06-15 16:55 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06


Attachments
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled (3.40 KB, patch)
2023-05-02 17:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled (3.45 KB, patch)
2023-05-02 19:37 UTC, David Nind
Details | Diff | Splinter Review
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled (3.51 KB, patch)
2023-05-02 20:25 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2023-04-27 01:06:47 UTC
This was first noticed in 22.11 but can confirm it happens in main too.

To reproduce:

1. Restart services
2. Go to Koha Administration -> Global system preferences and enable the TranslateNotices system preference
3. Go to Tools -> Notices & slips
4. Go to edit any notice i.e. ACCOUNTS_SUMMARY
5. Expand the Email section of the Default tab. Confirm there is no content in the notice  --> BUG
6. Click on the next language tab, then expand the Email section. It is probably empty if you've only just enabled TranslateNotices and have not set up specific notices for your installed languages so this is fine.
7. Go back to the Default tab and expand the Email section. Confirm the content now shows for the notice

It should show upon first expand of Email section.
Comment 1 Katrin Fischer 2023-05-01 13:18:21 UTC
Also confirmed in master. Wonder if this could have something to do with the work on tabs? Adding Owen.
Comment 2 Aleisha Amohia 2023-05-01 21:07:52 UTC
(I'm using main in place of master as much as possible hehe)
Comment 3 Katrin Fischer 2023-05-01 21:23:49 UTC
You are right - I think we also decided to switch, but haven't yet figured out the steps and timing. I mostly wanted to help this along saying I can see it too and I'd also really like to see it fixed - it could cause a bit of a panic when people think they lost their content.
Comment 4 Katrin Fischer 2023-05-02 07:55:10 UTC
I just checked our 22.11.03 instance and it still appears to be working ok there. Maybe another clue. Bug 32912 could be a possible candidate.
Comment 5 Owen Leonard 2023-05-02 17:51:50 UTC
Created attachment 150529 [details] [review]
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled

This patch fixes a conflict between the template-generated markup and
Bootstrap JS which were both competing to show the correct default tab.
It's simpler to rely on JavaScript.

To test, apply the patch and enable the TranslateNotices system
preference if necessary.

- Go to Tools -> Notices & slips
- Go to edit any notice e.g. DUEDGST
- The page should load with the "Default" tab selected by default.
- Enter unique titles and contents under each tab to confirm that the
  data you see under the "Default" or "English (en)" tab is being shown
  in the right place.
- Save your modified notice and edit it again to confirm that the tabs
  correspond correctly to your data.
Comment 6 David Nind 2023-05-02 19:37:36 UTC
Created attachment 150533 [details] [review]
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled

This patch fixes a conflict between the template-generated markup and
Bootstrap JS which were both competing to show the correct default tab.
It's simpler to rely on JavaScript.

To test, apply the patch and enable the TranslateNotices system
preference if necessary.

- Go to Tools -> Notices & slips
- Go to edit any notice e.g. DUEDGST
- The page should load with the "Default" tab selected by default.
- Enter unique titles and contents under each tab to confirm that the
  data you see under the "Default" or "English (en)" tab is being shown
  in the right place.
- Save your modified notice and edit it again to confirm that the tabs
  correspond correctly to your data.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-05-02 20:01:34 UTC
Testing notes (using KTD):

1. To replicate the issue (note: ACCOUNTS_SUMMARY has no email notice, DUEDGST does have an email notice) I had to install another language (other than just having the Default and English (en) tabs):
   - Install another language: koha-translate install fr-CA
   - Enable the language: Administration > System preferences > I18N/L10N > language > Français (fr-CA)
   - Enable the TranslateNotices system preference
   - Edit the DUEDGST notice
   - It opens on the Default tab: expand the Email notice --> it is blank
   - Click on the tabs for English (en) and Français (fr-CA), and expand the email notice section (should be blank, unless you've added translations already)
   - Click back on the Default tab and expand the Email notice --> it is now not blank
   - Refreshing the page resets things, so you can then replicate the issue again
Comment 8 Aleisha Amohia 2023-05-02 20:25:58 UTC
Created attachment 150535 [details] [review]
Bug 33622: Notice content does not show on default tab if TranslateNotices enabled

This patch fixes a conflict between the template-generated markup and
Bootstrap JS which were both competing to show the correct default tab.
It's simpler to rely on JavaScript.

To test, apply the patch and enable the TranslateNotices system
preference if necessary.

- Go to Tools -> Notices & slips
- Go to edit any notice e.g. DUEDGST
- The page should load with the "Default" tab selected by default.
- Enter unique titles and contents under each tab to confirm that the
  data you see under the "Default" or "English (en)" tab is being shown
  in the right place.
- Save your modified notice and edit it again to confirm that the tabs
  correspond correctly to your data.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 9 Tomás Cohen Arazi 2023-05-09 14:48:15 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-05-15 12:10:18 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 11 Lucas Gass 2023-06-15 16:55:06 UTC
Missing dependencies for 22.05.x, no backport.