Clicking on Local use tab in system preferences results in warning in log file: systempreferences.pl: Use of uninitialized value in length at (...)/admin/systempreferences.pl line 456 Reason: content field "value" in table "systempreferences" can be NULL (and is tested for length). Patch follows.
Created attachment 12752 [details] [review] Bug 8895 - Warning in systempreferences.pl: Use of uninitialized value in length... Clicking on Local use tab in system preferences results in warning in log file: systempreferences.pl: Use of uninitialized value in length at (...)/admin/systempreferences.pl line 456 Reason: content field "value" in table "systempreferences" can be NULL (and is tested for length). Added test for "defined" at to places.
Created attachment 12789 [details] [review] Bug 8895 - Warning in systempreferences.pl: Use of uninitialized value in length... Clicking on Local use tab in system preferences results in warning in log file: systempreferences.pl: Use of uninitialized value in length at (...)/admin/systempreferences.pl line 456 Reason: content field "value" in table "systempreferences" can be NULL (and is tested for length). Added test for "defined" at to places. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
QA comment: 2lines patch, add some variable check passed QA
Patch pushed because it's obviously correct, but on my test server, when I try to reach local use tab, I get a nasty: Syck parser (line 53, column 0): syntax error at /usr/lib/perl5/YAML/Syck.pm line 126, <$fh> line 1. (probably because i've no local use, but a nicer fallback would be welcomed !
QA comments: 1/ The line: unless (defined $data->{value}) { $data->{value} = "";} could be wrote as: $data->{value} //= ""; (with Modern::Perl). 2/ The Bug 2505 collects this kind of patch :) 3/ The line 424 has a useless test if defined( $data->{value} ) Marked as Failed QA for 3
Collision... :)
Oh, 3) was already in the original code and not the target of my patch.
(In reply to comment #5) > 3/ The line 424 has a useless test if defined( $data->{value} ) I had some trouble understanding what you were meaning... and have got it now ! I've pushed the patch with a follow-up removing the useless code (In reply to comment #7) > Oh, 3) was already in the original code and not the target of my patch. Marc, yes it was, but before your patch is was meaningfull. After your patch is was a dead code test, because the string has been defined 2 lines before. Anyway, problem fixed !
(In reply to comment #7) > Oh, 3) was already in the original code and not the target of my patch. Yes but before the patch the test was not useless :) Now it is, the value will never undefined. It's not a big deal! Anyway it is pushed :)
Definitely too slow today :)
Pushed to 3.8.x will be in 3.8.12