Re: Xaraya_user Digest, Vol 46, Issue 7
"Mark Frawley" <[email protected]> Sun, 22 Jun 2008 11:46:27 +0100
| Newsgroups | gmane.comp.cms.xaraya.user |
|---|---|
| Message-ID | <[email protected]> |
I just encountered this problem - Jojo's fix worked for me fine, I
prefer the following syntax however:
- $tplData['_bl_data'] = $tplData;
+
extract($tplData, EXTR_OVERWRITE);
+ $_bl_data = $tplData;
Also, the bigger issue is that the parameter checking is so bad that
the problem gets this far. Instead of using assertions which are
configuration dependent and not recommended by the PHP manual for
param checking, there should be type checking and/or exceptions thrown
if tplData is not an array.
The change in PHP 5.2.6 seems to be that a null value passed to a
function is now interpreted as undefined. The other types that
evaluate as being empty (false, '', 0) seem to be ok. One other thing,
the duplication of a variable in PHP is not costly unless you modify
the contents of the duplicated variable. Otherwise the refcount of the
initial zval is merely incremented..
Mark
On Thu, May 22, 2008 at 1:00 PM, <[email protected]> wrote:
> Send Xaraya_user mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://xaraya.com/mailman/listinfo/xaraya_user
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xaraya_user digest..."
>
>
> Today's Topics:
>
> 1. Re: Notice: Undefined variable: tplData in
> includes/xarTemplate.php on line 1056 (Ryan Walker)
> 2. Re: Notice: Undefined variable: tplData in
> includes/xarTemplate.php on line 1056 (Andreas Nyback)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 22 May 2008 00:10:35 -0400
> From: Ryan Walker <[email protected]>
> Subject: Re: [Xaraya_user] Notice: Undefined variable: tplData in
> includes/xarTemplate.php on line 1056
> To: Xaraya User List <[email protected]>
> Message-ID: <4834F23B.2070201-XGOUDnVriEBCJ2frC7IYSKxOck334EZe@public.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I got a slightly different error message on one site with PHP 5.2.6...
>
> ASSERTION FAILED: /path/to/includes/xarTemplate.php [1051] :
> is_array($tplData); /* Template data should always be passed in an array */
>
> The problem was fixed by editing xarTemplate.php as described below.
>
> -Ryan
>
>
>
> Michel V. wrote:
>> For reference:
>>
>> 5.2.6 gave me the same trouble.
>> First option below here solved it.
>>
>> Michel
>>
>> jojodee wrote:
>>
>>> jojodee wrote:
>>>
>>>
>>>> So we can fix it easy enough for now:
>>>>
>>>> $temp = $tplData;
>>>> $tplData['_bl_data']=$temp;
>>>>
>>>> or
>>>> tplData['_bl_data'] = &$tplData; should also work.
>>>>
>>>>
>>> last line should be: $tplData['_bl_data'] = &$tplData;
>>>
>>>
>>> I looked on php.net for any indication of changed error reporting or
>>> behaviour and found a few bugs but not quite the same.
>>>
>>> http://bugs.php.net/bug.php?id=43505 may be related.
>>>
>>> Jo
>>>
>>>
>> _______________________________________________
>> Xaraya_user mailing list
>> [email protected]
>> http://xaraya.com/mailman/listinfo/xaraya_user
>>
>>
>
>
> --
> Ryan Walker
> www.WebCommunicate.net:
> Insights and resources for effective websites.
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 22 May 2008 11:28:04 +0200
> From: Andreas Nyback <[email protected]>
> Subject: Re: [Xaraya_user] Notice: Undefined variable: tplData in
> includes/xarTemplate.php on line 1056
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> Its great to see all the activity here. It was so silent for long after
> i got the problem so i thought maybe i have something wrong in my
> install after all :-)
>
> No i did not file a bug. I had trouble to file it from my computer being
> a tor exit node and then I got a little discouraged from all the heavy
> spamming coming in to xarayas bugzilla lately so i let my
> procrastination side take control.
>
> Its a separate subject, but does someone know if its possible to stop
> all the spamming in bugzilla? Something must have happened since it
> suddenly went from no spam to a lot.
>
> /Andreas
>
>
>
> Michel V. skrev:
>>> I will add a bug report to xaraya bugzilla.
>>> /Andreas
>>
>> Have you already done so? So we can refer to it when solving it in the
>> code?
>>
>> Michel
>
>
> ------------------------------
>
> _______________________________________________
> Xaraya_user mailing list
> [email protected]
> http://xaraya.com/mailman/listinfo/xaraya_user
>
>
> End of Xaraya_user Digest, Vol 46, Issue 7
> ******************************************
>