Page Index Toggle Pages: 1 2 3 [4] 5  Send TopicPrint
Very Hot Topic (More than 25 Replies) BUGS!!! (Read 40600 times)
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #19 - May 9th, 2016 at 11:00am
Print Post  
Code
Select All
--- C:/Users/Mika/AppData/Local/Temp/Subs.pm-revBASE.svn000.tmp.pm	su touko  8 20:28:47 2016
+++ C:/msys64/home/Mika/yabb-svn/cgi-bin/yabb2/Sources/Subs.pm	ma touko  9 13:43:51 2016
@@ -780,10 +780,10 @@ sub image_resize {
             && $x[1] eq 'avatarml' )
         {
             if ( $max_avatarml_width && $x[2] !~ / width=./sm ) {
-                $x[2] =~ s/( style=.)/$1width:$max_avatarml_width\px;/sm;
+                $x[2] =~ s/( style=.)/$1width:${max_avatarml_width}px;/sm;
             }
             if ( $max_avatarml_height && $x[2] !~ / height=./sm ) {
-                $x[2] =~ s/( style=.)/$1height:$max_avatarml_height\px;/sm;
+                $x[2] =~ s/( style=.)/$1height:${max_avatarml_height}px;/sm;
             }
             $x[2] =~ s/display:none/display:inline/sm;
         }
 

  
Back to top
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #18 - May 9th, 2016 at 12:28am
Print Post  
Dandello wrote on May 9th, 2016 at 12:21am:
Another reason to start looking at SQL tables for data storage.  Smiley

I've got company this week so it will take a few days to track down all the file -> list spots with chomp so they can be processed properly. (Of course, if ActivePerl tossed the proper errors, I could see the problem myself.)


You just have to use stock perl with -w Wink
It's really fun when you set the error log to 300 lines and YaBB fills that up in just a minute Wink

I'm going to eye operation in early June, so I still have about 3 weeks to crash and fix YaBB. Dunno how many hours a day I play with YaBB as trying to stare the code with just one eye is not very fun.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #17 - May 9th, 2016 at 12:21am
Print Post  
Another reason to start looking at SQL tables for data storage.  Smiley

I've got company this week so it will take a few days to track down all the file -> list spots with chomp so they can be processed properly. (Of course, if ActivePerl tossed the proper errors, I could see the problem myself.)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #16 - May 8th, 2016 at 11:57pm
Print Post  
Dandello wrote on May 8th, 2016 at 10:38pm:

I'm trying to find some documentation on why and when (if?) text file contents became scalar context only and why ActivePerl 5.22.1 still allows file contents in list context if it's been deprecated.


I have no idea what version, but it has to do with how Perl handles empty records/lines in the file... The new guidelines strip empty lines from file but leaves lines like "0", "false" etc, which did equal empty line in the old system when using loop/push-to-array to read file contents. This also affect how chomp works as now it works on whole array instead of individual records. In old system empty record became line feed character stored as first item in the record; in new system, there is none records with empty data.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #15 - May 8th, 2016 at 11:50pm
Print Post  
Yeah, that $a should be a $c. ($a and $b are reserved variables and have been for a looong time.)

Quote:
In Register.template there is variable $field{'comment'}, but the declaration is out of scope.


That should be {yabb fieldcomment} with a fix in ExtendedProfiles.pm to accomodate the fix - find
Code
Select All
       $output =~ s/<label for="">/<label for="$name_id">/gsm; 


add after
Code
Select All
    $output =~ s/\Q{yabb fieldcomment}\E/$field{'comment'}/gxsm; 



I think we may have to turn the read-file-to-list solution into a new sub and make an 'upgrade to Perl 2.22.1' Mod. 
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #14 - May 8th, 2016 at 10:48pm
Print Post  
In ModifyMessage.pm near end is block

Code
Select All
    for my $c ( 0 .. ( @buffer - 1 ) ) {
        if ( ( split /\|/xsm, $buffer[$a], 6 )[4] < $newthreadline[4] ) {
            splice @buffer, $c, 0, join( q{|}, @newthreadline ) . "\n";
            $inserted = 1;
            last;
        }
    }
 



Perl says $a is invalid in this context, should it be $c instead?

In Register.template there is variable $field{'comment'}, but the declaration is out of scope.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #13 - May 8th, 2016 at 10:38pm
Print Post  
In these instances
Code
Select All
${ $uid . $username }{'regdate'}  

should be
Code
Select All
${ $uid . $username }{'regtime'}  



regtime is an Epoch number.

I'm trying to find some documentation on why and when (if?) text file contents became scalar context only and why ActivePerl 5.22.1 still allows file contents in list context if it's been deprecated.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #12 - May 8th, 2016 at 9:22pm
Print Post  
Dandello wrote on May 8th, 2016 at 3:29pm:
Monni wrote on May 8th, 2016 at 2:49pm:
So some variables were local to the scope instead of being global by default.


That still doesn't explain the apparent issue with running 2.6.11 under Perl 5.10 on your *nix host. (Although for 2.7 I have been cleaning up the regexes (5 different versions of the same regex is 4 too many) and going through the variable scopes - making sure that blanks and text aren't being processed as numbers, etc.) 

When you have your YaBB install back on track, please post what you needed to do to get it to work.


So far commented out two lines inside if blocks that fail miserably in ModifyMessage.pm as 'regdate' is never numeric

Quote:

#               ${ $uid . $username }{'regdate'} >= $mdate


Quote:

#                ${ $uid . $username }{'regdate'} > $message[3] ||


Also all reads of line-based data now use "readline HANDLE" instead of "<HANDLE>"
and if it reads all lines, it uses 
Quote:

my @arr = ();
my $var;
while (defined($var = readline HANDLE)) {
    push (@arr, $var);
}
chomp @arr;


when it opens a file and doesn't croak on failure, it actually checks the return value of fopen() and doesn't try to do anything if it doesn't return true.

I had to revert a lot of my fixes so I could upgrade to 2.6.12, so I can't make full patch containing all the edits yet...
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #11 - May 8th, 2016 at 4:18pm
Print Post  
fix going into 2.7.12 (This is one of the reasons that whole section is being reworked for 2.7 - what happens if the non-English Help files and English Help files don't match up?)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #10 - May 8th, 2016 at 3:41pm
Print Post  
Quote:

sub CreateOrderFile {
    if ( opendir HELPDIR, "$helpfile/$language/$help_area" ) {
        @contents = readdir HELPDIR;
        closedir HELPDIR;
    } elsif ( opendir HELPDIR, "$helpfile/English/$help_area" ) {
        @contents = readdir HELPDIR;
        closedir HELPDIR;
    }


    foreach ( sort { uc($a) cmp uc $b } @contents ) {
        ( $name, $extension ) = split /\./xsm, $_;
        next if $extension !~ /help/ism;
        $order_list .= "$name\n";
    }

    fopen( HELPORDER, ">$vardir/$help_area.helporder" )
      or croak(
"couldn't write order file - check permissions on $vardir and $vardir/$help_area.helporder"
      );
    print {HELPORDER} qq~$order_list~ or croak "$croak{'print'} HELPORDER";
    fclose(HELPORDER);
    return;
}


Otherwise the HelpCenter is completely empty.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #9 - May 8th, 2016 at 3:29pm
Print Post  
Monni wrote on May 8th, 2016 at 2:49pm:
So some variables were local to the scope instead of being global by default.


That still doesn't explain the apparent issue with running 2.6.11 under Perl 5.10 on your *nix host. (Although for 2.7 I have been cleaning up the regexes (5 different versions of the same regex is 4 too many) and going through the variable scopes - making sure that blanks and text aren't being processed as numbers, etc.) 

When you have your YaBB install back on track, please post what you needed to do to get it to work.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #8 - May 8th, 2016 at 2:49pm
Print Post  
Dandello wrote on May 8th, 2016 at 2:02pm:
Monni wrote on May 8th, 2016 at 12:36pm:
I added "push @INC, '.';" to YaBB.pl before "push @INC, './Modules';" when using Perl 5.22.1 so it loads YaBB... Have to check if it works any better...


I was posting and researching when you made this post - again, I can't reproduce the problems you're having using Apache 2.22 and ActivePerl 5.22.1. (Remember to make the same changes to the @INC in AdminIndex.pl)


I use ActivePerl on my home machine and it seems it has less issues than Unix stock Perl... The remaining issues I mainly noticed were how in some places proper language files were not loaded or variable substitution failed because variable was defined in different scope than it was used... So some variables were local to the scope instead of being global by default.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #7 - May 8th, 2016 at 2:02pm
Print Post  
Monni wrote on May 8th, 2016 at 12:36pm:
I added "push @INC, '.';" to YaBB.pl before "push @INC, './Modules';" when using Perl 5.22.1 so it loads YaBB... Have to check if it works any better...


I was posting and researching when you made this post - again, I can't reproduce the problems you're having using Apache 2.22 and ActivePerl 5.22.1. (Remember to make the same changes to the @INC in AdminIndex.pl)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #6 - May 8th, 2016 at 1:56pm
Print Post  
Make sure 'use warnings' is NOT in YaBB.pl and there is no '-w' or '-W' in the shebang.  Add
Code
Select All
no warnings qw(uninitialized once redefine); 

to all the .pm and .pl files just below the copyright block. That MAY stop the warnings you're seeing. I have no idea what changes on the server may be causing YaBB to be throwing warnings to the YaBB error.log except that what's in the log tells me that warnings is turned on somehow.

For the other errors: 
in MediaCenter.pm find
Code
Select All
            @media_in = split /\&/gxsm, $media_in; 

and change it to
Code
Select All
            @media_in = split /\&/xsm, $media_in; 

(Don't know when that error crept in  Embarrassed.)

The epoch time error looks like a language support issue. In BoardIndex.pm find
Code
Select All
        if (   ${ $uid . $curboard }{'lastposttime'} ne 'N/A' 

and replace with
Code
Select All
        if (   ${ $uid . $curboard }{'lastposttime'} =~ m{\A[0-9]+\Z}xsm 

(We're changing looking for NOT 'N/A' to making sure the field only contains numbers.)  I'm sure there are a lot more issues related to language support.

Unfortunately, I really have no idea what change on your server is triggering warnings. I do know it's not due to the Perl version.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #5 - May 8th, 2016 at 12:36pm
Print Post  
I added "push @INC, '.';" to YaBB.pl before "push @INC, './Modules';" when using Perl 5.22.1 so it loads YaBB... Have to check if it works any better...
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 2 3 [4] 5 
Send TopicPrint