PHP error line 227-237 in lib/item.php

Posts from previous Beta sessions

PHP error line 227-237 in lib/item.php

Postby tuigii » Sun Sep 02, 2007 5:44 am

It's here : http://www.papy-team.fr/roster_20b1/ind ... &member=23 (I might have changed outfit ...)
My weapon is a fishing rod :wink:
Anyway : 4 php error are present - two on the two same lines.

I propose a small $html =''; on line 208, like this :
Code: Select all
    function _getWeapon()
    {
        
$html ='';
        if( isset(
$this->attributes['WeaponType']) && isset($this->attributes['WeaponSlot']) )
        {
... 


As is done in other functions.

I didn't included the patch yet in my file (is there like a // $html$=''; right now) - so you can see the errors.
Last edited by tuigii on Wed Oct 17, 2007 2:47 pm, edited 5 times in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

PHP error line 227-237 in lib/item.php

Postby ds » Sun Sep 02, 2007 10:45 am

Fixed in SVN: 1294 (well not really... wasn't broke) ;)

Note on how _getWeapon() operates:
This method is not meant to verify, it is only meant to generate it's part of the html code. If the function got all the way to the return without creating $html then something is wrong before this. In this example, if _getWeapon() was called the property flag item::isWeapon must be true. The only way that property could be true is if the attributes called in the method exist. The real problem with the code is that the language file is missing a keyword in one of it's patterns.
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

Re: PHP error line 227-237 in lib/item.php

Postby tuigii » Mon Sep 03, 2007 1:13 am

Ok, got it.

I resynched item.lib & frFR.php with the latest and greatest SVN.

It was my 'gun' : localized group "Armes à fue"
In frFR.pho it's being recognized if called ...||Armes à feu||... : remove the 's' and I have 2 errors are down.
It in the $lang['tooltip_weapon_types'].

That (was) it ?

I continue for the other 2 'line 323 php errors...

I think it's because WeaponDPS is set, without any other 'Weapon....' attribute, like 'Bullets' (hé, just found another frFR issue here :-)) :
So, what about this one :
Code: Select all
if( isset($this->attributes['WeaponDPS']) )
{
    if ( isset(
$html) )
    {
        
$html .= $this->attributes['WeaponDPS'] . '<br />';
    }
    else
    {
        
$html $this->attributes['WeaponDPS'] . '<br />';
    }
}
 

instead of :
Code: Select all
    if( isset($this->attributes['WeaponDPS']) )
    {
        
$html .= $this->attributes
    
}
 

Because if $html isn't being set already so something (even an empty string) then one can't do a "$html .=xxx" = adding a string to an existing string.

Bullets (FR : Balles) : frFR.php : line
Instaed of :
Code: Select all
$lang['tooltip_weapon_types']='Hache|Arc|Arbaléte|Dague|Canne Ã  pêche|Arme de pugilat|Arme Ã  feu|À une main|Masse|Main droite|Arme d\'hast|Bâton|Epée|Armes de jet|Baguette|Tenu\(e\) en main gauche'// the types of weapons as shown in the tooltip 

use
Code: Select all
$lang['tooltip_weapon_types']='Hache|Arc|Arbaléte|Balle|Dague|Canne Ã  pêche|Arme de pugilat|Arme Ã  feu|À une main|Masse|Main droite|Arme d\'hast|Bâton|Epée|Armes de jet|Baguette|Tenu\(e\) en main gauche'// the types of weapons as shown in the tooltip 

I added "|Balle" on the fourth position - to recognize FR:Bullets :wink:
{and removed a 's' like stated above, at the beginning of the post}

It's your move :D
Last edited by tuigii on Mon Sep 03, 2007 1:28 am, edited 1 time in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

PHP error line 227-237 in lib/item.php

Postby ds » Mon Sep 03, 2007 2:20 am

I fixed so many things It might have fixed itself. I added bullets and arrows and other missing types I found from my user provided CP data (thanks guys!). When the new nightly build comes out try that and let me know where I missed anything. Also, please make sure you over write your fixes with the official code. Thanks for your work in helping me fix these errors!
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

Re: PHP error line 227-237 in lib/item.php

Postby tuigii » Mon Sep 03, 2007 2:59 am

ds wrote:...Also, please make sure you over write your fixes with the official code.


Don't worry. Before even grabbing a pencil I'll reset the roster to the latest version.
Right now : I have a synched 1.9.9.1291 (meaning "no diffs" or what so ever).

It's strange to know that others (ok, it was a dev :wink: ) are already talking about issues ([url=http://www.wowroster.net/Forums/viewtopic/p=26080.html#26080]svn[1295] - "Cannot use string offset as an array"
[/url]) about 1294 - which isn't public yet (Zanix needs his head getting strait :D + :lol: ).
What I mean: know one should lose time talking about issues already being taken care of.

I'll wait for the next roster sync - and confirm my findings afterwards.

PS : the edit for the frFR.php, like arme instead of armes seems to me a solide case solver, like adding '|Balle' in the $lang['tooltip_weapon_types'] line. These are just wrong (first case) and missing (second case) when I compare with et usUS.php version.
Last edited by tuigii on Mon Sep 03, 2007 3:02 am, edited 1 time in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron