Bug 29056 - Remove demo functionality remnants
Summary: Remove demo functionality remnants
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Peter Vashchuk
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on: 12227
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-20 08:42 UTC by Andrew Nugged
Modified: 2021-10-17 01:17 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 29056: Remove the demo functionality leftovers (1.86 KB, patch)
2021-09-20 11:13 UTC, Peter Vashchuk
Details | Diff | Splinter Review
Bug 29056: Remove the demo functionality leftovers (1.93 KB, patch)
2021-09-24 14:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29056: Remove the demo functionality leftovers (2.07 KB, patch)
2021-09-25 09:37 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Nugged 2021-09-20 08:42:07 UTC
found some remnants of "C4::Context->config('demo')": 
in /svc/config/systempreferences line 68:

`unless ( C4::Context->config('demo') ) { ... `

this "demo" was removed everywhere so should be removed in svc/config/systempreferences too
Comment 1 Andrew Nugged 2021-09-20 08:44:53 UTC
also to note maybe for separate tickets later (needs to be analyzed):

this

    `unless ( C4::Context->config('demo') ) { ... `

it's never failed because it returns _REFERENCE_TO_HASH_,
even the hash is empty:


```
sub set_preferences {
    warn C4::Context->config( 'demo' );
    warn C4::Context->config( 'demo' ) ? 'TRUTH' : 'FALSE';
    warn Dumper(C4::Context->config( 'demo' ));

    unless ( C4::Context->config('demo') ) {
        ...
```

Gives:
[2021/09/20 10:42:56] [WARN] HASH(0x5646ead56e00)
[2021/09/20 10:42:56] [WARN] TRUTH
[2021/09/20 10:42:56] [WARN] $VAR1 = {};

We might have other "if/unless ->config" usages not even for the "demo" key in our code which might be degraded with this "always true" trick.
Comment 2 Peter Vashchuk 2021-09-20 11:13:52 UTC
Created attachment 125051 [details] [review]
Bug 29056: Remove the demo functionality leftovers

Remove forgotten code of the old legacy demo functionality that was
removed from elsewhere except systempreferences, this code not only
serves no purpose but also is causing some troubles for our customers.
Comment 3 Martin Renvoize 2021-09-24 14:57:43 UTC
Created attachment 125255 [details] [review]
Bug 29056: Remove the demo functionality leftovers

Remove forgotten code of the old legacy demo functionality that was
removed from elsewhere except systempreferences, this code not only
serves no purpose but also is causing some troubles for our customers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Joonas Kylmälä 2021-09-25 09:37:19 UTC
Created attachment 125305 [details] [review]
Bug 29056: Remove the demo functionality leftovers

Remove forgotten code of the old legacy demo functionality that was
removed from elsewhere except systempreferences, this code not only
serves no purpose but also is causing some troubles for our customers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 5 Joonas Kylmälä 2021-09-25 09:39:25 UTC
Passing QA.

@nugged: I wonder how you were able to get C4::Context->config return an empty hash, it seems like somehow somewhere that code didn't manage to find a configuration file or there is a bug in the C4::Context code. Would love to hear more about this in case it turns out to be a bug in C4::Context.
Comment 6 Jonathan Druart 2021-09-28 13:39:36 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 7 Kyle M Hall 2021-10-08 12:02:33 UTC
Pushed to 21.05.x for 21.05.05
Comment 8 Fridolin Somers 2021-10-09 02:34:36 UTC
Pushed to 20.11.x for 20.11.11

Leftovers are always served cold with ketchup ^^
Comment 9 Victor Grousset/tuxayo 2021-10-17 01:17:01 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.