Fatal error: Call to a member function on a non-object in...

xlr8or

Joined: 2002-08-31
Posts: 4
Posted: Sat, 2002-08-31 15:33

Since adding an album (with a nested album within) i keep getting this error on trying to enter /gallery/ with a browser:

Fatal error: Call to a member function on a non-object in /home/sites/site153/web/gallery/classes/Album.php on line 718

Next code is on that location:

function numHidden() {
$cnt = 0;
for ($i = 1; $i <= $this->numPhotos(1); $i++) {
$photo = $this->getPhoto($i);
line 718: if ($photo->isHidden()) {
$cnt++;

I have already upgraded to 1.3.1... and been browsing other messages with similar problems. Read that it could be a corrupted album. But I cannot determine what album, and have got no clue on repairing this problem.

Additional info environment:

Server: Sun Cobalt RAQ4
OS: Sun Cobalt OS 6.0 ( Linux rev66.dhcp 2.2.16C28_III #1 Mon Jul 30 22:07:58 PDT 2001 i586 )
PHP: Version 4.1.2
Gallery-URL: http://www.enschedeseboys.nl/gallery
Albums-URL: http://www.enschedeseboys.nl/albums

Please help me on this...

thanx in advance

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2002-08-31 18:47

Post the URL to your Gallery and I'll examine your database remotely.

 
xlr8or

Joined: 2002-08-31
Posts: 4
Posted: Sun, 2002-09-01 08:59

URL to the gallery and the albums is allready in the first message, but here they are again:

gallery-URL : http://www.enschedeseboys.nl/gallery
Albums-URL: http://www.enschedeseboys.nl/albums

oops... i will disable the redirect in the albums-dir so you can access the albumdb...

thanks for helping.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2002-09-03 04:49

Ok, it looks like the nieuws and upload albums are corrupt. Not sure how this happened, but you can move them out of the albums directory and then rebuild them and it should work again.

 
xlr8or

Joined: 2002-08-31
Posts: 4
Posted: Sun, 2002-09-08 10:38

Okay, I tried moving them out of the directory, but permissions conflict...

I am using a hosting provider and here's what happens.
The albums and their files are owned by httpd, mod is 755, so as a member of the group i have no permissions to change it. Moving them out of the dir is therefore not possible.

I guess i could ask the admin to do that for me, but i'd like to feel a bit more in control myself... is there some way of working around this problem, without having to ask the admin or not?

I can imagine there are more users (of hosting co's) having this problem...

Thanks in advance
xlr8or

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2002-09-08 20:03

In the User Guide->Scripts section there is a script that handles
this very problem. Grab it, ftp it to your gallery directory and
load it up in a browser, then do what you need to do.

 
xlr8or

Joined: 2002-08-31
Posts: 4
Posted: Mon, 2002-09-09 06:45

thanx... all up and running again.

Compliments on an excellent piece of work! Gallery is great and so is your help.

xlr8or

 
songlines

Joined: 2007-11-09
Posts: 14
Posted: Sun, 2009-12-27 23:34

could you please post the URL of that script? I have got the same problem with my gallery installation

http://www.ciaf-milano.com/gallery/

thank you for your help

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-12-28 22:36

http://codex.gallery2.org/Downloads:Cleanup_Script
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Procyon

Joined: 2008-11-30
Posts: 42
Posted: Fri, 2010-09-17 21:30

I'm having the same problem. It seems to run the scrip fine, but we have a very large database of pictures, so eventually it says this:

Fatal error: Maximum execution time of 30 seconds exceeded in /home/XXXX/public_html/gallery/cleanup.php on line 41

I've checked the cleanup.php file, but see not time settings.

Thanks for the help. Here you can see the main error: http://www.ww2incolor.com/german/

 
Procyon

Joined: 2008-11-30
Posts: 42
Posted: Sun, 2010-09-19 21:29

I still have the same error and would appreciate some help on it!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2010-09-19 22:12

@Procyon, this is a gallery1 forum, your error has to do with gallery2.
There are fewer supporters of G1 and therefore fewer answers.

But now that I see your error, it looks as if that one item has been corrupted, can you delete it and re-upload.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Procyon

Joined: 2008-11-30
Posts: 42
Posted: Mon, 2010-09-20 02:51

thanks! how did you find which file it is? (so that i know for the future)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2010-09-20 03:01

the fatal error message itself was a link to the item.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Procyon

Joined: 2008-11-30
Posts: 42
Posted: Mon, 2010-09-20 22:38

ok thanks.