[Bug 8849] New: Error log generated when not a demo system
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Priority: P5 - low Change sponsored?: --- Bug ID: 8849 CC: gmcharlt@gmail.com Assignee: koha-bugs@lists.koha-community.org Summary: Error log generated when not a demo system Severity: trivial Classification: Unclassified OS: All Reporter: mtompset@hotmail.com Hardware: All Status: NEW Version: rel_3_8 Component: System Administration Product: Koha As a result of: [Mon Oct 01 15:28:59 2012] [error] [client 192.168.100.2] [Mon Oct 1 15:28:59 2012] marctagstructure.pl: Use of uninitialized value in numeric eq (==) at /usr/share/koha/intranet/cgi-bin/admin/marctagstructure.pl line 152. in Koha 3.8.5 this patch was generated. The line reads unless (C4::Context->config('demo') == 1) { which produces an error long entry while tweaking frameworks. It should read: unless (defined(C4::Context->config('demo')) && C4::Context->config('demo') == 1) { -- though this will still generate an error if the value isn't numeric. I'm going to assume that whoever does use it, will use it correctly. My understanding is that this value must be set to 1 in koha-conf.xml to prevent writing out MARC Framework changes (adds or modifies). However, since 'demo' is not defined in the default koha-conf.xml, this generates an error. This feature is not documented anywhere, as far as I know. Though 'demo' code does seem to exist in a couple places in Koha. Patch to follow. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- It would seem that admin/auth_tag_structure.pl, admin/marc_subfields_structure.pl, admin/marctagstructure.pl, and admin/auth_subfields_structure.pl all need their condition revised. However, since I only found marctagstructure.pl in the error logs and since I can reproduce it, only marctagstructure.pl will be fixed. However, not with a ==1 or eq 1, but by removing the operator portion completely as is elsewhere. This is a grep from 3.8.x: $ grep "'demo'" `find .` ./admin/auth_tag_structure.pl: unless (C4::Context->config('demo') eq 1) { ./admin/auth_tag_structure.pl: unless (C4::Context->config('demo') eq 1) { ./admin/marc_subfields_structure.pl: unless ( C4::Context->config('de mo') eq 1 ) { ./admin/marc_subfields_structure.pl: unless ( C4::Context->config('demo') eq 1 ) { ./admin/preferences.pl: unless ( C4::Context->config( 'demo' ) ) { ./admin/marctagstructure.pl: unless (C4::Context->config('demo') == 1) { ./admin/marctagstructure.pl: unless (C4::Context->config('demo') == 1) { ./admin/auth_subfields_structure.pl: unless (C4::Context->con fig('demo') eq 1) { ./admin/auth_subfields_structure.pl: unless (C4::Context->config('demo') eq 1 ) { ./admin/systempreferences.pl: unless ( C4::Context->config('demo') ) { ./admin/systempreferences.pl: unless ( C4::Context->config('demo') ) { ./admin/systempreferences.pl: unless ( C4::Context->config('demo') ) { ./admin/systempreferences.pl: unless ( C4::Context->config('demo') ) { ./C4/Auth.pm: if ( $userid && $userid eq 'demo' ./C4/Auth.pm: && "$password" eq 'demo' ./C4/Auth.pm: && C4::Context->config('demo') ) ./C4/Auth.pm: elsif ( $userid eq 'demo' && C4::Context->config('demo') ) { ./debian/scripts/koha-run-backups:# - dump all sites, except one called 'demo' ./svc/config/systempreferences: unless ( C4::Context->config('demo') ) { ./svc/config/systempreferences: unless ( C4::Context->config( 'demo' ) ) { ./installer/InstallAuth.pm: && $userid eq 'demo' ./installer/InstallAuth.pm: && "$password" eq 'demo' ./installer/InstallAuth.pm: && C4::Context->config('demo') ) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |mtompset@hotmail.com |ity.org | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 12616 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12616&action=edit Fix error logging triggered by adding/editing/deleting tags on framework Test ----- 1) Login 2) Administration 3) MARC bibliographic framework 4) Click 'MARC structure' for any framework. (May be a good idea to copy a frame work and choose the copy, since we will be deleting things!) 5) Click 'Edit' for any field. 6) Change values and then click 'Save Changes'. 7) Click 'Delete' for that field now. 8) click 'Yes, Delete this Tag' 9) Click 'OK' 10) click 'New Tag' 11) Let's enter the tag value of what we just deleted and put some dummy values in. 12) Check the error logs. There should be three errors. The first and last will be for the edit/add, and the middle will be for the delete. 13) Apply patch 14) repeat steps 3 through 12. 15) Error log entries those errors are no longer generated. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- This bug applies to master, 3.8.x, and 3.6.x versions of koha. Patch was generated from master. Applied to all three. Let me know if there's a problem. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 --- Comment #4 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 12674 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12674&action=edit Bug 8739 follow-up fixing perlcritic error This patch is not related nor introduced by bug 8739, but while qa-ing it, I found those 2 perlcritic violation this patch fixes it ! I also fixed a tiny indentation problem -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12616|0 |1 is obsolete| | Attachment #12674|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 12707 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12707&action=edit Bug 8849 - Error log generated when not a demo system Changed two lines similar to: unless (C4::Context->config('demo') == 1) { into lines similar to: unless (C4::Context->config('demo')) { By removing the == 1, undefined = false without an error. The value of demo is supposedly set by a koha-conf.xml variable, but there is very little documentation on this "demo mode" beyond the set it to 1 in koha conf for demo mode. Also, demo doesn't exist in the default koha-conf.xml file generated. So anyone who knows to create it, will likely create it the proper way and with the proper value. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12674|1 |0 is obsolete| | --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 12674 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12674 Bug 8739 follow-up fixing perlcritic error Fixes perl-critic errors unrelated to this bug, but found while QA-ing this bug, but this patch still needs sign off. Not sure how it got obsoleted in the first place. Making this not obsoleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12674|0 |1 is obsolete| | --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 12674 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12674 Bug 8739 follow-up fixing perlcritic error moved obsolete attachment to bug 7595 as per wajasu's suggestion. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12707|0 |1 is obsolete| | --- Comment #8 from wajasu <matted-34813@mypacks.net> --- Created attachment 12718 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12718&action=edit 0001-SIGNED-OFF-Bug-8849-Error-log-generated-when-not-a-demo.patch When testing as comment #2 enumerates, I just tailed the log, and saved the interaction. Then I did the same after the patch. I compared the two visually, and saw the error messages pertaining to the == error were gone. The editor functioned editing/saving just fine. Yes there is other uninitialized error noise from other places(in master only). I applied it to master, origin/3.8.x and origin/3.6.x as well, and they applied cleanly, and all passed testing. TEST PASSED. wajasu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matted-34813@mypacks.net --- Comment #9 from wajasu <matted-34813@mypacks.net> --- Though targeted at 3.8, so don't lose track that it should also be applied to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |paul.poulain@biblibre.com QA Contact| |paul.poulain@biblibre.com --- Comment #10 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: * tiny patch * koha-qa.pl OK, except for a problem that was here before the patch (a tab) passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Paul Poulain <paul.poulain@biblibre.com> --- FYI : the "demo" mode has been introduced a long time ago -by me IIRC- If set to 1, there user ca log-in with demo/demo, whatever the database, and can't modify sysprefs & some other setups (not sure I remember exactly which ones) I agree it's deeply deprecated and could be completely removed from Koha In the meantime, patch pushed -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8849 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x, will be in 3.8.7 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org