ZenphotoCMS Forum
1.6a error in deprecated-functions.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: 1.6a error in deprecated-functions.php (/thread-13736.html)



1.6a error in deprecated-functions.php - eclrgp - 05-08-2022

Hello,
There are references to $Image in deprecated-functions.php in 1.6a which need to be changed to $Images

WARNING: Undefined variable $image in /var/www/html/ZenPhoto/zp-core/zp-extensions/deprecated-functions/deprecated-functions.php on line 408

getRandomImages called from zpB_getRandomImages (functions.php [102])

from include (home.php [24])

from include (index.php [9])

from include (index.php [128])

from index.php [80]


These are the changes to deprecated-functions.php


405c405
< &#36;potd = array('day' => time(), 'folder' => &#36;image->getAlbumName(), 'filename' => &#36;image->getName());


      &#36;potd = array('day' => time(), 'folder' => &#36;images->getAlbumName(), 'filename' => &#36;images->getName());

408c408
< return &#36;image;


  return &#36;images;

Ray




1.6a error in deprecated-functions.php - acrylian - 05-08-2022

We can fix that but actually you should fix the usage of deprecated function itself and use the recommended replacement instead. The plugin itself will also be deprecated in the final 1.6.




1.6a error in deprecated-functions.php - eclrgp - 08-08-2022

I agree but I wanted to try using the zpBootstrap theme but keeping the number of fixes to it to a minimum




1.6a error in deprecated-functions.php - acrylian - 08-08-2022

I understand. It is deprecated since 1.5.8. At some time it will have to be fixed.

It should be fixed now.




1.6a error in deprecated-functions.php - eclrgp - 08-08-2022

Thank you. I see you have not changed &#36;image to &#36;images in line 405




1.6a error in deprecated-functions.php - acrylian - 09-08-2022

Yes, you are right, was a quick fix inbetween just looking at the error line above, with a plain text editor that does not notify on unused vars. Should be fixed now.




1.6a error in deprecated-functions.php - eclrgp - 09-08-2022

Thank you again