• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

This bug was introducing in the last few commits. (I know it because I was running a test-drive Dakar for receiving feedback from TWiki Brazil people and it was working correctly until I run a `svn update` around Sun Sep 25 05:12:40 UTC 2005 (the last must be done yesterdaty after my big I18N commits).

TWiki crashes is with this message:

| 25 Sep 2005 - 01:58 | Can't use string ("HASH(0x8b37378)") as a HASH ref while "strict refs" in use at /home/terceiro/src/twiki/lib/TWiki/UI/Register.pm line 937.
 at /home/terceiro/src/twiki/lib/TWiki/UI/Register.pm line 937
        TWiki::UI::Register::_buildConfirmationEmail('TWiki=HASH(0x892624c)', 'HASH(0x8b376b8)', 'From: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%>\x{a}To: %FIRSTLASTNAM...', 'undef') called at /home/terceiro/src/twiki/lib/TWiki/UI/Register.pm line 887
        TWiki::UI::Register::_emailRegistrationConfirmations('TWiki=HASH(0x892624c)', 'HASH(0x8b376b8)') called at /home/terceiro/src/twiki/lib/TWiki/UI/Register.pm line 672
        TWiki::UI::Register::verifyEmailAddress('TWiki=HASH(0x892624c)', '/home/terceiro/src/twiki/data/RegistrationApprovals') called at /home/terceiro/src/twiki/lib/TWiki/UI/Register.pm line 83
        TWiki::UI::Register::register_cgi('TWiki=HASH(0x892624c)') called at /home/terceiro/src/twiki/lib/TWiki/UI.pm line 107        TWiki::UI::__ANON__() called at /home/terceiro/src/twiki/lib/Error.pm line 387
        eval {...} called at /home/terceiro/src/twiki/lib/Error.pm line 379
        Error::subs::try('CODE(0x8b2b668)', 'HASH(0x8b2c274)') called at /home/terceiro/src/twiki/lib/TWiki/UI.pm line 156
        TWiki::UI::run('CODE(0x88d869c)') called

I detected that the files in data/RegistrationApprovals are being created like this:

# Verification code
$VAR1 = {
          'FirstName' => 'Terceiro',
          'passwordB' => 'teste',
          'form' => [
                      'HASH(0x8cc5d88)',
                      'HASH(0x8cc5de8)',
                      'HASH(0x8cc5ecc)',
                      'HASH(0x8cc5ef0)',
                      'HASH(0x8cc5f2c)',
                      'HASH(0x8ccf2a8)',
                      'HASH(0x8ccf2f0)',
                      'HASH(0x8ccf338)'
                    ],
          'passwordA' => 'teste',
          'WikiName' => 'TerceiroTestandoMaisUmaVez',
          'Confirm' => 'teste',
          'Password' => 'teste',
          'LastName' => 'Testando mais uma vez',
          'Email' => 'asaterceiro@inf.ufrgs.br',
          'webName' => 'Main',
          'VerificationCode' => 'TerceiroTestandoMaisUmaVez.4416',
          'Comment' => ' ',
          'Country' => 'Slovakia',
          'CompanyURL' => '',
          'CompanyName' => '',
          'LoginName' => 'TerceiroTestandoMaisUmaVez',
          'Name' => 'Terceiro Testando mais uma vez'
        };

In the place of those stings like 'HASH(0x?????????)', there should be actual hash references, as I noticed they were before I did the `svn update`.

AT

broken sometime before SVN:6575 -- WN


Very weird: if I put writeWarning='s inside =TWiki::UI::Register::_getDataFromQuery to output Dumper($data), it converts the hash references to scalars ('HASH(0x?????????)'). But if I write another CGI script that only outputs Dumper($data) (where $data is the result of TWiki::UI::Register::_getDataFromQuery) it outputs correctly.

For example, if you save TWikiRegistration locally and change de form action to /tiwki/bin/test with this test script:

BEGIN {
    # See the 'view' script for a description of what this does
    if( $ENV{"SCRIPT_FILENAME"} &&
        $ENV{"SCRIPT_FILENAME"} =~ /^(.+)\/[^\/]+$/ ) {
        chdir $1;
    }
    unshift @INC, '.';
    require 'setlib.cfg';
}

use TWiki::UI;
use TWiki::UI::Register;
#TWiki::UI::run( \&TWiki::UI::Register::register_cgi );
use CGI qw( :cgi -any );
use Data::Dumper;

my $query = new CGI;
my $data = TWiki::UI::Register::_getDataFromQuery($query);

print $query->header(-type  =>  'text/plain');
print Dumper($data);

With this I can get the dumped data correctly as it should be written to the RegistrationApproval file.

AT


Don't ask me why, but this patch makes the thing work:

=== Register.pm
==================================================================
--- Register.pm (revision 9557)
+++ Register.pm (local)
@@ -1099,7 +1099,9 @@
     }
     open( F, ">$file" ) or throw Error::Simple( 'Failed to open file: '.$! );
     print F '# Verification code',"\n";
-    print F Dumper( $data );
+    my $form = $data->{form};
+    delete $data->{form};
+    print F Dumper( $data, $form );
     close( F );
 }

@@ -1117,9 +1119,10 @@
 sub _getRegDetailsByCode {
     my ( $code, $tmpDir ) = @_;
     my $file = _verificationCodeFilename( $code, $tmpDir );
-    use vars qw( $VAR1 );
+    use vars qw( $VAR1 $VAR2 );
     do $file;
     throw Error::Simple( 'Bad activation code '.$code ) if $!;
+    $VAR1->{form} = $VAR2;
     return $VAR1;
 }

AT

I believe you, but I can't reproduce this error. I am using perl 5.8.1, perhaps your version is broken?

The only thing I can suggest is that we apply your patch, though this does make me rather nervous that there may be other examples waiting for us.

Since I can't test if the problem is fixed (since it works for me anyway) could you please check in your patch when you are happy? Thanks.

CC

Committed your patch as 6668 CC


Man, this is so misterious, so misterious, that I can't reproduce it anymore, even after I reverted my local changes for that patch and didn't pulled svn changes yet!

Maybe we could revert it ...

AT

Nah, no point. Just watch for it happening again. Closing. CC

ItemTemplate
Summary Entering verification code crashes TWiki - waiting for AT
ReportedBy AntonioTerceiro
AppliesTo Engine
Priority Urgent
CurrentState Closed
WaitingFor

Checkins 6668
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2005-09-29 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback