•  » Extensions
  •  » Batch Downloader is throwing php errors

#1 2024-10-07 19:55:10

rajdude
Member
2021-05-18
97

Batch Downloader is throwing php errors

Greetings,

In the past the batch downloader was working fine, but after the latest upgrade (to version 14.5), it has been throwing errors. Two errors happen:

If in its configuration, I set the size to "original", I get this error at the page where it is supposed to start the zipping process...

Downloader Warning: Undefined array key "SIZE_INFO" in file.init_zip.tpl.php on line 153

This error does NOT happen, if I do not set the download pic size.


The other error happens when I click on the link to download. On the next page, I get this error which starts with:

Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /home/rajivm/public_html/photos/admin/include/pclzip.lib.php:2674 Stack trace: #0 xxxx pclzip.lib.php(2674)


I have already tried to totally remove this plugin and re-install it in my Piwigo server.

Any other solution?


Environment

    Piwigo 14.5.0 Check for upgrade
    Installed on 25 February 2022, 2 years 7 months 1 week 2 days ago
    Operating system: Linux
    PHP: 8.3.11 (Show info) [2024-10-07 13:52:23]
    MySQL: 8.0.39-cll-lve [2024-10-07 13:52:23]
    Graphics Library: External ImageMagick 6.9.13-14
    Cache size 766.17 Mo   calculated 2 weeks ago Refresh

Activated plugin list 10

    Additional Pages
    Advanced Menu Manager
    Batch Downloader
    Embedded Videos
    Extended Description
    gdThumb
    Grum Plugins Classes.3
    LocalFiles Editor
    ShareAlbum
    Take A Tour of Your Piwigo




Piwigo URL: http://rajdude.com/photos

Offline

 

#2 2024-10-08 01:17:31

rajdude
Member
2021-05-18
97

Re: Batch Downloader is throwing php errors

I am wondering if @mistic100 is still around :-)

If not, is there someone else who is supporting this plugin now?

Offline

 

#3 2024-10-08 17:13:24

rajdude
Member
2021-05-18
97

Re: Batch Downloader is throwing php errors

I may have found a solution for this problem. I noticed that this plugin was complaining that it could not find ZipArchive on my webhost, so it will use PclZip. I went into my host's cPanel and went to
Software > Select PHP version
On that page under "Z" I enabled the checkbox for Zip

After that the error showing up in this plugin's setting page went away. I was then able to download the album as a zip file using the cloud button on my photo album's page.

Notes:
1. Also went away was the error related to undefined array and this one:
Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0.

2. This error is still there, if "Photo size choices" is set to One size = Original
Downloader Warning: Undefined array key "SIZE_INFO" in file.init_zip.tpl.php on line 153

Offline

 

#4 2024-10-27 05:16:58

klinsinow
Member
2019-01-20
7

Re: Batch Downloader is throwing php errors

I just had the same error today when I updated Piwigo from 14.3 to 14.5. Had errors pop up even when clicking on the Setting button for Batch Downloader. Didn't record down full details of the errors but similar or same as first post. Finally figured out I could revert the plugin by downloading the previous version (13.a) from Piwigo website and overwriting the Batch Downloader sub-folder under plugins using SFTP. I didn't want to click on the "revert" button on my website plugin settings page as I didn't know if it would clear out settings or not. Reverting back to version 13.a fixed the issue for me, although not really a fix OF the issue.

I do have users that use the Batch Downloader so hoping someone out there can provide full fix.

Also hoping mistic100 still around!

Or maybe if someone can confirm successful functionality of Batch Downloader (vs 13.a or newer) with Piwigo 15. The plugin did mention full functionality for 14, so I'm hesitant to upgrade to Piwigo 15 until I know the newest version of Batch Downloader works on Piwigo 15.

Piwigo 14.5.0
PHP: 8.0.30
MySQL: 5.7.23-23

Last edited by klinsinow (2024-10-27 05:23:33)

Offline

 

#5 2024-12-02 12:04:42

shutterfreak
Member
2024-08-28
3

Re: Batch Downloader is throwing php errors

If this may help, here is an error report I got after upgrading from 14.5 to 15:

Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in .../gallery/admin/include/pclzip.lib.php:2674
Stack trace:
#0 .../gallery/admin/include/pclzip.lib.php(2674): fread(Resource id #159, 0)
#1 .../gallery/admin/include/pclzip.lib.php(2504): PclZip->privAddFile(Array, Array, Array)
#2 .../gallery/admin/include/pclzip.lib.php(2406): PclZip->privAddFileList(Array, Array, Array)
#3 .../gallery/admin/include/pclzip.lib.php(2141): PclZip->privAddList(Array, Array, Array)
#4 .../gallery/admin/include/pclzip.lib.php(409): PclZip->privCreate(Array, Array, Array)
#5 .../gallery/plugins/BatchDownloader/include/BatchDownloader.class.php(1010): PclZip->create('./_data/downloa...', 77004)
#6 .../gallery/plugins/BatchDownloader/include/BatchDownloader.class.php(528): myZip->__construct('./_data/downloa...', true)
#7 .../gallery/plugins/BatchDownloader/include/events.inc.php(103): BatchDownloader->createNextArchive(true)
#8 .../gallery/include/functions_plugins.inc.php(264): batch_download_index_button()
#9 .../gallery/index.php(367): trigger_notify('loc_end_index')
#10 {main} thrown in .../gallery/admin/include/pclzip.lib.php on line 2674

And the offending line reads as:

Code:

        // ----- Read the file content
        $v_content = @fread($v_file, $p_header['size']);

This probably means that

Code:

$p_header['size']

is either not defined or zero as of Piwigo 15.

Last edited by shutterfreak (2024-12-02 14:09:24)

Offline

 
  •  » Extensions
  •  » Batch Downloader is throwing php errors

Board footer

Powered by FluxBB