Various 3.65.01 issues

Found something that doesn't work as expected? Encountered PHP errors? Submit your bug reports here!
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Various 3.65.01 issues

Postby slightlysome » Sun May 19, 2013 5:28 pm

When testing my plugins with PHP 5.4 and Nucleus 3.65.01 I found some problems:

doTemplateVar function in plugins wasn't called with the following in the error log:
PHP Warning: Parameter 1 to NP_LMLabels::doTemplateVar() expected to be a reference, value given in nucleus/libs/ITEMACTIONS.php on line 493
Diff for suggested change in ITEMACTIONS.php:

Code: Select all

491c491,492
<               $params = array_merge(array($this->currentItem),$params);
---
>               $params = array_merge(array(&$this->currentItem),$params);
>               $func = array(&$plugin, 'doTemplateVar');
493c494
<               call_user_func_array(array($plugin, 'doTemplateVar'), $params);
---
>               call_user_func_array($func, $params);


In error log:
PHP Warning: date() expects at most 2 parameters, 4 given in nucleus/libs/showlist.php on line 345
PHP Warning: date() expects at most 2 parameters, 4 given in nucleus/libs/showlist.php on line 346
Diff for suggested change in showlist.php:

Code: Select all

345,346c345,347
<                       echo "    <br />",_LIST_ITEM_DATE," " . date("Y-m-d",$current->itime,ENT_QUOTES,_CHARSET);
<                       echo "<br />",_LIST_ITEM_TIME," " . date("H:i",$current->itime,ENT_QUOTES,_CHARSET);
---
>                       echo "    <br />",_LIST_ITEM_DATE," " . date("Y-m-d",$current->itime);
>                       echo "<br />",_LIST_ITEM_TIME," " . date("H:i",$current->itime);
>


PHP failed without writing to the error log. Nucleus seems to sets error_reporting() so that not all fatal errors are written to the log. The following error was not written to the error log when using the error_reporting() set in nucleus:
PHP Fatal error: Call-time pass-by-reference has been removed....
Diff for suggested change in globalfunctions.php:

Code: Select all

34c34
<     error_reporting(E_ERROR | E_WARNING | E_PARSE);
---
>     error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR | E_COMPILE_WARNING);
- Leo -
LMNucleus CMS home page: nucleus.slightlysome.net
My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com
My Nucleus plugins.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sat Aug 10, 2013 5:18 pm

Found some more bugs in Nucleus 3.65.01 that causes the doItemVar and doTemplateCommentsVar functions not to be called in plugins when running under PHP 5.4.

Diff for suggested change in COMMENTACTIONS.php:

Code: Select all

354,355c354,356
<               $params = array_merge(array($this->currentComment), $params);
<               $params = array_merge(array($this->commentsObj->itemActions->currentItem), $params);
---
>               $params = array_merge(array(&$this->currentComment), $params);
>               $params = array_merge(array(&$this->commentsObj->itemActions->currentItem), $params);
>               $func = array(&$plugin, 'doTemplateCommentsVar');
357c358
<               call_user_func_array(array($plugin, 'doTemplateCommentsVar'), $params);
---
>               call_user_func_array($func, $params);


Diff for suggested change in BODYACTIONS.php:

Code: Select all

88c88,89
<               $params = array_merge(array($this->currentItem),$params);
---
>               $params = array_merge(array(&$this->currentItem),$params);
>               $func = array(&$plugin, 'doItemVar');
90c91
<               call_user_func_array(array($plugin, 'doItemVar'), $params);
---
>               call_user_func_array($func, $params);
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
donQ
Posts: 94
Joined: Sat Oct 21, 2006 11:42 am
Location: Scotland

Postby donQ » Sun Sep 01, 2013 10:56 am

I don't know if this is linked to bugs mentioned, but I upgraded to 3.65 from 3.64 and my default blog did not display properly.

Some of the background, some buttons, footer and some other parts were missing. I could not get them back, even tried reinstall. This only happened on default, two other blogs were okay. One of the other blogs had an identical skin and it was okay, only the default was affected.

I have PhP 5.36 and MySQL 5.1. After checking everything it was the same. Have gone back to 3.64 for now, which works very well.
User avatar
WillyP
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH
Contact:

Postby WillyP » Mon Sep 02, 2013 2:41 pm

3.65 is intended for those having problems on php 5.4. If you are using 5.3, 3.64 is the correct version.

Return to “Bug Reports & Feature Requests”