Page Index Toggle Pages: 1 [2] 3 4 5 ReplyAdd Poll Send Topic
Very Hot Topic (More than 25 Replies) BUGS!!! (Read 17643 times)
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #15 - May 8th, 2016 at 11:50pm
Mark & QuoteQuote  
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
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #16 - May 8th, 2016 at 11:57pm
Mark & QuoteQuote  
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
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #17 - May 9th, 2016 at 12:21am
Mark & QuoteQuote  
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
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #18 - May 9th, 2016 at 12:28am
Mark & QuoteQuote  
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
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #19 - May 9th, 2016 at 11:00am
Mark & QuoteQuote  
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
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #20 - May 9th, 2016 at 1:22pm
Mark & QuoteQuote  
To fit the pattern of the others in the set
Code
Select All
$x[2] =~ s/( style=.)/$1height:$max_avatarml_height$px;/sm; 



That whole section SO needs to be reworked.  Undecided
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #21 - May 9th, 2016 at 1:43pm
Mark & QuoteQuote  
Dandello wrote on May 9th, 2016 at 1:22pm:
To fit the pattern of the others in the set
Code
Select All
$x[2] =~ s/( style=.)/$1height:$max_avatarml_height$px;/sm; 



That whole section SO needs to be reworked.  Undecided


Using $px instead of "px" is just overkill... Not to mention variable names with anything else than 0-9,a-z,A-Z are discouraged, also variables $a and $b are reserved for internal use... I also noticed in one of the files, there is two variables that differ only in letter capitalization even though Perl is inherently case insensitive when it comes to variable names.

There is both $nextMessid and $nextMessId in InstantMessage.pm...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #22 - May 9th, 2016 at 2:03pm
Mark & QuoteQuote  
The capitalization issues are VERY old in YaBB (like first version). And using $a and $b in inappropriate places is also very old in YaBB - so if you see an $aa or a $bb - that was my quick fix for that section.

Perl isn't all that case insensitive (at least in English) otherwise it couldn't tell the difference between $MyVar and $myvar and it can. However, $MyVar is very bad form and PerlCritic has hissy fits over it.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #23 - May 9th, 2016 at 2:13pm
Mark & QuoteQuote  
Dandello wrote on May 9th, 2016 at 2:03pm:
The capitalization issues are VERY old in YaBB (like first version). And using $a and $b in inappropriate places is also very old in YaBB - so if you see an $aa or a $bb - that was my quick fix for that section.

Perl isn't all that case insensitive (at least in English) otherwise it couldn't tell the difference between $MyVar and $myvar and it can. However, $MyVar is very bad form and PerlCritic has hissy fits over it.


In the example I updated on the previous post, the second variable is always undefined, because when you assign a value, it can't decide which variable the user means. As usually the warning is supressed without running "perl -w" and is silently ignored as the second variable is implicitly equal to empty string. At least on the version I used, Perl is case insensitive, but case preserving... So the first variable name gets used even if you explicitly try to declare second variable with similar name but differing in capitalization.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #24 - May 9th, 2016 at 3:17pm
Mark & QuoteQuote  
Since this is appears to be a real issue but it doesn't appear to negatively affect the vast majority of YaBB installs, I think we should make the capitalization changes in 2.7 (Pushing back the release to August or so. I was hoping for June 1.) and not worry about it for older versions of YaBB.

I still think there's something very odd happening with your *nix host setup. (Like an update to mod_security or something like that.) YaBB should NOt be identifying your Perl version as 5.10 if you're seeing 5.22 issues.

Edited:
And for 2.7 that 100 or so lines of code now looks like
Code
Select All
        if ($fix_img_size{$x[1]}[0] && $perl_do_it == 1 ) {
             if ($fix_img_size{$x[1]}[1] && $x[2] !~ /\s width=./xsm ) {
                 $x[2] =~ s/( style=.)/$1width:$fix_img_size{$x[1]}[1]px;/xsm;
             }
             if ($fix_img_size{$x[0]}[2] && $x[2] !~ /\s height=./xsm ) {
                 $x[2] =~ s/( style=.)/$1height:$fix_img_size{$x[1]}[2]px;/xsm;
             }
             $x[2] =~ s/display:none/display:inline/xsm;
         } 



All the variables related to image resize are in a hash - will also make it easier to add other resizable images in the future.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #25 - May 9th, 2016 at 3:44pm
Mark & QuoteQuote  
Dandello wrote on May 9th, 2016 at 3:17pm:
I still think there's something very odd happening with your *nix host setup. (Like an update to mod_security or something like that.) YaBB should NOt be identifying your Perl version as 5.10 if you're seeing 5.22 issues.


Well... The server admin already admitted they f*cked up the Perl upgrade... Obviously they did upgrade the primary Perl version from 5.8 to 5.10, but they also installed Perl 5.22 as separate installation aside the existing separate installation of 5.14. YaBB didn't work for me with Perl 5.8 so I was using the Cpanel-installed 5.14 until it stopped working... Then I downgraded to 5.10, because it did start loading the forum, but got lots of croaks... With 5.22 I haven't had even a single croak yet after I fixed the @INC issue. I had to reset some user files in cgi-bin/yabb2/Members because all the croaking did truncate them. As far as I can tell, I've posted all the changes that made the forum behave with Perl 5.22 as it used to behave with 5.14 before all hell did freeze over due to the upgrade failing.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #26 - May 9th, 2016 at 4:06pm
Mark & QuoteQuote  
Like I said, this YaBB install is running on cPanel's Perl 5.08 and runs fine on the Perl 5.14 install as well (I don't run this one in with the 5.14 because I can't update the Perl Modules like I can with the 5.08 install.)

The readline fix should be backwards compatible, although I still haven't found any good documentation on when chomp stopped behaving when readline outputs to list.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #27 - May 9th, 2016 at 4:52pm
Mark & QuoteQuote  
Dandello wrote on May 9th, 2016 at 4:06pm:
The readline fix should be backwards compatible, although I still haven't found any good documentation on when chomp stopped behaving when readline outputs to list.


I really don't bother reading any ChangeLogs as long as things just work... Most online FAQs about Perl have conflicting information that pretty much assumes people never use "perl -w" to see if their code actually works as expected... The main problem with anything regarding Perl is implicit cast and how people use it to avoid error checking... readline returns undef on error, so it should be enclosed in defined() always... also chomp should be the first statement after while-push loop so it can scan the whole array and strip linefeeds and empty items. the next thing is that arrays are never in scalar context, so checking array size by implicit cast does not work as expected. Always have to use "scalar @array" or "$#array + 1" to check array size. "$." returns number of records/items read from file before chomp but after while-push loop, but not after chomp. If you try to chomp too late, you will end up passing single linefeed character to chomp and it will return empty string, which is in most cases not what you wanted.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: BUGS!!!
Reply #28 - May 9th, 2016 at 5:42pm
Mark & QuoteQuote  
Most people don't test adequately and then there's the added complication that YaBB just plain won't work under strict without disabling a good chunk of the requirements.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: BUGS!!!
Reply #29 - May 9th, 2016 at 5:45pm
Mark & QuoteQuote  
Dandello wrote on May 9th, 2016 at 5:42pm:
Most people don't test adequately and then there's the added complication that YaBB just plain won't work under strict without disabling a good chunk of the requirements.


I shouldn't complain... I charge 200 EUR/h for fixing people's forums Wink
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 5
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
BUGS!!!

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry