Hi,
Since a couple of days when I add/delete items (foto's and albums) I get for example the following error message in my browser:
Warning: Wrong datatype for first argument in call to in_array in /home/robv/public_html/gallery2/modules/core/classes/Gallery.class on line 834
Warning: Cannot add header information - headers already sent by (output started at /home/robv/public_html/gallery2/modules/core/classes/Gallery.class:834) in /home/robv/public_html/gallery2/main.php on line 453
The foto's/albums have been added/delete from the gallery !!!!!!
Robin
<TYPE YOUR MESSAGE HERE, ENTER SYSTEM DETAILS BELOW>
<Please check the G2 FAQ (sticky topic in this forum) before posting!>
----
Gallery URL (optional):
Gallery version: latest csv version
Webserver (with version): Apache/1.3.27 (Unix) (Red-Hat/Linux)
Datatabase (with version): mysql Ver 11.17 Distrib 3.23.49a, for pc-linux-gnu (i686)
PHP version (eg 4.2.1): 4.1.2
phpinfo URL (optional):
Graphics Toolkit(s): ImageMagick / NetPMB
Operating system: Linux version 2.4.9-31custom (root@telematics.xs4all.nl) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)) #1 Wed Jun 12 13:27:55 GMT-1 2002
Web browser/version: FireFox 1.04 and IE v6 SP2
G1 version (for migration bugs): None
Posts: 32509
Let's first check if your albums/photos really have been deleted.
go to you g2data directory, and check g2data/albums/. Are your albums and photos still there?
Background:
Theoretically, in most setups on shared webhostings, other customers of the same shared webhosting have enough permissions to delete all your data in g2data (via scripts that run under the webserver user).
And if the problem in Gallery.class persists, we'll have to debug a little.
Posts: 6
Hi,
When I add photo's (using the web interface) the fotos are copied to the g2data/albums directorie. When I delete them again they are removed from the g2data/albums.
I have full (root) access to the server I'm running the gallery from. But because more users are using this server i'm running the gallery under my own user account.
What do I have to do to debug this futher and track down the problem...
Robin
Posts: 32509
Ah, sorry. I guess I didn't understand you correctly, my bad.
That's why I thought your albums/photos have been deleted.
But I guess the message was "i get an error during add/delete operations, but the add/delete operations still work."
So, let's concentrate on that Gallery.class function addShutdownAction() error.
Are you ready to debug it?
We'd have to activate the buffered debug mode in config.php.
And we'd have to change
The function addShutDownAction() of Gallery.class would need to be changed a little to output some debug information.
replace:
with:
then try to cause the error (add/delete an item) and search the debug output for "addShutdownAction" and print the results here in the forum.
It's up to you...
Posts: 8601
Ah, checked the php docs and I used something not allowed in PHP 4.1.x.
I'll look into a fix.
Edit: valiant, I see your post now.. the problem is in_array($x,$y).. $x cannot be an array in PHP 4.1.x.
Posts: 32509
mmkay
first checked the php manual too, but forgot about checking if the first element can be an array.
Hmm, wonder if have used that incorrectly too.
Posts: 6
Hi,
When I create and album name "tes1t":
Then i delete the album "test1":
After this I try to create album test1 again (test1 was delete from my) I now get a different error (its a lot)
I also have a "smart debug console output"
Hope this helps...
Robin
Posts: 6
Some additions.
I could not create the test1 album for a second time because the album was not delete from the g2data/albums directory. When i manualy removed it I could recreate the album again !
Robin
Posts: 32509
rvermaat, thank you.
mindless already found the problem. We're using a php functionality that was introduced in a later php than you have installed. But this not your problem, because we want G2 to work on older php setups.
Please stay tuned, we're trying to fix the problem and it might be fixed in a future G2 version.
Posts: 8601
fix in cvs; update in a few hours or get tomorrow's nightly snapshot.
Posts: 6
Updated to the latest cvs and now everything works fine again