Piwigo / piwigo-videojs

Videojs port for piwigo. Play your videos on your web gallery!
http://piwigo.org/ext/extension_view.php?eid=610
GNU General Public License v3.0
64 stars 45 forks source link

Synchronization Error #184

Open ElGatoFlojo opened 2 years ago

ElGatoFlojo commented 2 years ago

Hi! In admin.php?page=plugin&section=piwigo-videojs%2Fadmin%2Fadmin.php&tab=sync I have an error:

(): Expected parameter 1 to be an array, null given in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 53 Notice: Undefined index: output in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 66 Warning: array_merge(): Expected parameter 1 to be an array, null given in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 78 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 90 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 94 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 108 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 114 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_dependencies.php on line 38 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_sync2.php on line 52 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_sync2.php on line 52 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/include/function_sync2.php on line 52 Notice: Trying to access array offset on value of type null in /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php on line 190 Warning: Cannot modify header information - headers already sent by (output started at /mnt/SYSTEM/WEB/Images/plugins/piwigo-videojs/admin/admin_sync.php:53) in /mnt/SYSTEM/WEB/Images/include/page_header.php on line 94

Piwigo 12.2.0 FreeBSD PHP: 7.4.26 [2022-02-01 16:03:06] MySQL: 5.5.5-10.5.13-MariaDB [2022-02-01 16:03:06] GD bundled (2.1.0 compatible)

Thanks

nfazor commented 2 years ago

Same problem here:

myfqdn.loc/admin.php?page=plugin&section=piwigo-videojs%2Fadmin%2Fadmin.php&tab=sync

Warning: array_merge(): Expected parameter 1 to be an array, null given in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 53

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 90

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 94

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 190

myfqdn.loc/admin.php?page=batch_manager

Warning: array_merge(): Expected parameter 1 to be an array, null given in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 151

Warning: array_merge(): Expected parameter 1 to be an array, null given in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 176

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_dependencies.php on line 38

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 52

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 52

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 52

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 77

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 84

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 112

Notice: Trying to access array offset on value of type null in /var/www/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 202

myfqdn.loc/admin.php?page=plugin&section=piwigo-videojs/admin/admin_photo.php&image_id=1391

Fatal error: Uncaught Error: Unsupported operand types in /var/www/piwigo/plugins/piwigo-videojs/include/exiftool.php:58
Stack trace: #0 /var/www/piwigo/plugins/piwigo-videojs/admin/admin_photo.php(109): include() 
#1 /var/www/piwigo/admin/plugin.php(53): include_once('/var/www/piwigo...') 
#2 /var/www/piwigo/admin.php(320): include('/var/www/piwigo...') 
#3 {main} thrown in /var/www/piwigo/plugins/piwigo-videojs/include/exiftool.php on line 58

I'm actually using:

Piwigo 12.2.0 
Oracle Linux (SELinux permissive)
PHP: 7.4.27 
MySQL: 5.5.5-10.3.28-MariaDB 
ImageMagick 6.9.12-35

Good luck!

rajdude commented 2 years ago

I am getting the same problem, but slightly different error.......... please help! No thumbnails are generated, making the video link look ugly (it is a reel).

Warning: array_merge(): Expected parameter 1 to be an array, null given in /home/rajivm/public_html/photos/plugins/piwigo-videojs/admin/admin_sync.php on line 53

Notice: Undefined index: output in /home/rajivm/public_html/photos/plugins/piwigo-videojs/admin/admin_sync.php on line 66

Warning: array_merge(): Expected parameter 1 to be an array, null given in /home/rajivm/public_html/photos/plugins/piwigo-videojs/admin/admin_sync.php on line 78

rajdude commented 2 years ago

I have mediainfo installed in this path /home/rajivm/mediainfo

Do I have to edit line 32 in this file to this?

/home/rajivm/public_html/photos/plugins/piwigo-videojs/admin/admin_sync.php

'mediainfo' => '/home/rajivm/mediainfo',

rajdude commented 2 years ago

By the way, as per the instructions here: https://github.com/Piwigo/piwigo-videojs/wiki/Using-MediaInfo%2C-ffmpeg-without-installing-it-inside-the-hosting-system

I have already modified this file 'piwigo-videojs/include/admin/admin_photo.php' line 64

PS: I see an option to put the path of mediainfo on the tab VideoJS plugin [Synchronize] ...but it does not take it....throws the same line 53 error at the top of the browser page.

I have even removed the path from the two files, hoping that the config page will start working, I mean I was hoping that it will take the path....but no-go there also :-(

PLEASE HELP ! :-)

xvdessel commented 1 year ago

I had the same error, and did some digging to find a solution. The first error is the one at line 53 of admin_sync.php, and that then repeats on line 78. Each time it is about array errors.

There are 2 separate problems that cause this. Firstly, the code in admin_sync.php is wrong, I fear. The aim of the code section between line 30 and 82 is to determine the sync options. They are derived in 3 layers: first the defaults (line 32-47), then the values from the persistent database (using the vjs_sync conf), and finally the user specified overrides from the URL request (line 59-74). On line 53 the first merge occurs (defaults + DB values) which then gets stored in the $sync_options variable. Note that this merge is conditional on the existence of any DB values. Therefore, on line 78, one should do the next merge. It is, but instead of using the previous merge result, the code refers to the DB values via the $conf of vjs_sync. That implies that, when no DB values exist, the merge will fail (not on line 53, but on line 78). This leads to a bad variable $sync_options, which is then written to the database. Any subsequent run will read that faulty DB config entry and fail again, this time on line 53 and on line 78. Note that no errors will occur if you have a valid DB entry for vjs_sync. It will get updated and saved at each run.

So a first correction is this: Change line 78 of admin_sync.php to read like this. $sync_options = array_merge($sync_options, $sync_options_form); This ensures the correct merge occurs, and if no vjs_sync values exist, the defaults will be used.

But that alone is not enough: The merge on line 53 will still fail as the DB value is not OK. Hence, use phpMyAdmin to go to table piwigo_config, and look for the record with vjs_sync. Most likely, it will not be correctly formatted. A nicely formatted value starts with "a:3:{s:9:"some text"..." (the numbers can be different. See the php serialize function for details). If your entry looks like this, all should be fine. if it is not (mine contained an uppercase N and a few other symbols), simply delete the vjs_sync record. With the above code change, you will get the defaults to start with. Now go bach to your videoJS Synchronize page, and you should get it working. Note that missing binaries will generate warnings, but that won't stop you from using this Synchronize (assuming you have at least one of the tools installed).

I hope this helps!

Xavier