Bug 28775 - Warn when viewing itemtypes.pl
Summary: Warn when viewing itemtypes.pl
Status: RESOLVED DUPLICATE of bug 29040
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-28 13:11 UTC by Nick Clemens (kidclamp)
Modified: 2021-12-16 09:19 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the cause of unnecessary warning messages in the log files when accessing the Administration > Item types page in the staff interface. Before this fix, multiple warning messages "[WARN] Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121." appeared in the log files.
Version(s) released in:
Circulation function:


Attachments
Bug 28775: Pass interface to getTranslatedLanguages (1.39 KB, patch)
2021-07-28 13:14 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28775: Pass interface to getTranslatedLanguages (1.43 KB, patch)
2021-07-30 19:21 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 Nick Clemens (kidclamp) 2021-07-28 13:11:29 UTC
Browse to: Administration -> Item types administration
[WARN] Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.
Comment 1 Nick Clemens (kidclamp) 2021-07-28 13:14:16 UTC
Created attachment 123249 [details] [review]
Bug 28775: Pass interface to getTranslatedLanguages

Don't pass undef for interface, we are on the staff client

To test:
1 - Browse to Administration -> Item types administration
2 - See in logs:
    [WARN] Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.
3 - Apply patch
4 - Reload page
5 - No warn
Comment 2 David Nind 2021-07-30 19:21:51 UTC
Created attachment 123345 [details] [review]
Bug 28775: Pass interface to getTranslatedLanguages

Don't pass undef for interface, we are on the staff client

To test:
1 - Browse to Administration -> Item types administration
2 - See in logs:
    [WARN] Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.
3 - Apply patch
4 - Reload page
5 - No warn

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2021-08-20 09:14:14 UTC
It seems to me that this fix is too easy.
Can be translated may well pertain to the OPAC (not staff only). For instance we use staff in English, but OPAC in Dutch and English.

If you look at the module routine, you see that no interface means OPAC + Intranet in returned languages. Giving another result in the above scenario.

Please adjust the routine? Passing empty string might be a cheap solution but probably not the nicest ;)
Comment 4 Marcel de Rooy 2021-12-16 09:19:21 UTC

*** This bug has been marked as a duplicate of bug 29040 ***