Opened 14 years ago

Closed 14 years ago

#212 closed defect (fixed)

Uninitialized variable warning in t/70_admin_home

Reported by: Dominic Hargreaves Owned by: Andrew Black
Priority: normal Milestone:
Component: openguides Version: svn
Severity: normal Keywords: hackfestsummer2007-reviewed
Cc:

Description (last modified by Dominic Hargreaves)

t/70_admin_home....................ok 1/12Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.                              
Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.
Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.
Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.
Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.
Use of uninitialized value in concatenation (.) or string at /home/dom/working/openguides/trunk/blib/lib/OpenGuides.pm line 1959.

Attachments (2)

70_admin_home.t.patch (2.0 KB) - added by Andrew Black 14 years ago.
70_admin_home.patch (2.0 KB) - added by Andrew Black 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 years ago by Dominic Hargreaves

Description: modified (diff)

comment:2 Changed 14 years ago by Andrew Black

Owner: changed from Nobody to Andrew Black
Status: newassigned

comment:3 Changed 14 years ago by Kake

Keywords: hackfestsummer2007-reviewed added

comment:4 Changed 14 years ago by Andrew Black

47:     # Test the tt vars
48:     my %ttvars = eval {
49:            $guide->display_admin_interface( return_tt_vars=> 1 );
50      };
 

sub display_admin_interface {
   ......
        $node->{'revert_user_url'} = $script_name . "?action=revert_user" .
                        ";username=".$node->{metadata}->{username}->[0];

$node->{metadata}->{username} is not defined

0  HASH(0x94cffe4)
   'last_modified' => '2007-06-10 15:45:36'
   'metadata' => HASH(0x949b0a4)
      'category' => ARRAY(0x94cf1c8)
         0  'Locales'
   'moderate' => 0
   'moderation_url' => 'wiki.cgi?action=set_moderation;id=Locale_Bar'
   'name' => 'Locale Bar'
   'version' => 2
   'versions_url' => 'wiki.cgi?action=list_all_versions;id=Locale_Bar'
   'view_url' => 'wiki.cgi?id=Locale_Bar'

Changed 14 years ago by Andrew Black

Attachment: 70_admin_home.t.patch added

Changed 14 years ago by Andrew Black

Attachment: 70_admin_home.patch added

comment:5 Changed 14 years ago by Andrew Black

I have changed the use of $wiki->write_node to OpenGuides::Test->write_data This creates a username, which the write_node routine did not.

One side effect is that write_data auto creates categories. so the following test has changed

+is( scalar @{$ttvars{'categories'}}, 2, "Right number of categories" );

Could this be recorded in the change history

comment:6 Changed 14 years ago by kake

Resolution: fixed
Status: assignedclosed

(In [1062]) Apply Andrew's patch, fixes #212 (uninitialised value warnings in test 70). Incidental change: use OpenGuides::Test->write_data instead of Wiki::Toolkit->write_node, hence change in number at line 59, since OpenGuides::Test autocreates categories and locales and Wiki::Toolkit doesn't.

Note: See TracTickets for help on using tickets.