Howdy,
I am attempting to move an image from one folder to another. An error message flashes up for less than a second. I had to make a video and pause it to type the error below: (Text in {}'s omitted by me. Odd newline placement as displayed.)
----------------------------------------------------------------------
Notice
: Undefined index: move in
{path to domain}/piwigo/admin/batch_manager_global.php
on line
201
Warning
: Cannot modify header information - headers already sent by (output started at {path to domain}/piwigo/admin/batch_manager_global.php)
{path to domain}/piwigo/include/page_header.php
on line
94
----------------------------------------------------------------------
This looks like the same problem as https://piwigo.org/forum/viewtopic.php?id=26773
As I am getting a similar message. I am hesitant to just edit the php code since that is a 5 year old problem and I am not that familiar with php. Also, wouldn't it just break again when it gets updated?
Environment details: (Running on a dreamhost server)
Piwigo 11.4.0
Operating system: Linux
PHP: 7.2.34 (Show info) [2021-04-11 18:44:30]
MySQL: 5.7.29-log [2021-04-11 18:44:35]
Graphics Library: ImageMagick 6.9.7-4
Piwigo URL: {private}
Any idea what is going on and what I need to do to fix this?
Thanks in advance.
Offline
I googled (site:piwigo.org inurl:release) and found Version 2.8.0 released July 8th, 2016 and assumed that was the version at the time (christianm on August 1, 2016).
Excerpt from piwigo/admin/batch_manager_global.php (v2.8.0)
196: else if (isset($_SESSION['bulk_manager_filter']['category'])
197: and $_POST['move'] != $_SESSION['bulk_manager_filter']['category'])
christianm changed line 197 to:
197: and (isset($_POST['move']) ? $_POST['move'] : null) != $_SESSION['bulk_manager_filter']['category'])
The version I have (11.4.0) had a same error on line 201:
200: else if (isset($_SESSION['bulk_manager_filter']['category'])
201: and $_POST['move'] != $_SESSION['bulk_manager_filter']['category'])
So, exactly the same code as the older version.
I got to learn some php:
isset: Determine if a variable is declared (not the same as null).
X ? Y : Z Means IF X is true THEN Y ELSE Z (ternary if-then-else)
$_POST looks like a hash.
The test on 200-201 (and old version 196-197):
... else if session bulk_manager_filer/category is set AND post move does not equal sesson bulk_manager_filter/category
christianm's edit:
... else if session bulk_manager_filer/category is set AND (if post move is set THEN post move, otherwise null) does not equal sesson bulk_manager_filter/category
So christianm's edit tests if $_POST['move'] is set. if it is it uses it, otherwise it uses null and compares it (post move or null) to session bulk_manager_filter/category.
That mostly makes sense to me. It did test if the session hash was set, so why not the post one?
I am not familiar with this code at all, so what I do not understand is why it would or would not be set.
Also, if this is a bug, why it's still there from 5 years ago? Surely I am not the first person since christianm to need to move a file? If I make this edit, will it break again at the next upgrade? I thought I would just register this as a bug but the bug tracker doesn't seem to be working either (http://piwigo.org/bugs just times out/504). Anyone?
Thanks
Offline
If that was a general failure then there likely were more reports about it..
However, the old bug tracker link is outdated, please use https://github.com/Piwigo/Piwigo/issues instead.
Offline
Update:
It's been two weeks and I have not been able to figure this out. In desperation I went ahead and made the edit suggested by the link above.
The error has gone away. But it now just quietly fails to move the image.
Thinking it was a permission issue I have tried multiple file permissions and still it does nothing.
I would really appreciate help with this issue.
Thanks
Offline
I'm still stuck with images in the wrong album. When I attempt to move the image to a different album it stays in the original album. I did notice that when I edit the image, the album I moved it to is listed in "Linked Albums" along with the original album. I can click on an X on the new album and remove it (not what I want to do) but the original album does not have an X.
Maybe this information would be beneficial for someone to help me with this. I've been at this nearly a month trying to move these images to another album!
Thanks
Offline
Disable ALL plugins and then move your image.
You can also reenable plugins one by one to see where the culprit is.
It could also be related ot a theme or anything else that isn't part of the standard installation.
Offline
I have not added any themes or plugins. I deactivated "LocalFiles Editor" which was the only plugin enabled and I am still unable to move the photos out of the album.
I tried moving a lot of photos and it the only ones I am unable to move were ftp'd to the server, rather than uploaded via the web interface. It seems like a permission issue but the folders and images have the same permissions and, as I said, I tried a ton of different permissions.
Offline