Recent Topics

1 Oct 01, 2014 05:39    

Hi,
Got a PHP error on page profile on frontend (/index.php?disp=user).
Happen for any skin, but it's working depending of users.

Fatal error: Call to a member function is_image() on a non-object in [...]/inc/users/model/_user.class.php on line 3625

Thanks
Mel

2 Oct 02, 2014 08:36

Hi @mel_t,

Well, the problem is caused by an inconsistent state between a couple of tables. Now, the question is, how did they get that state?

Did you upgrade from an earlier version? Which one? Did those users uploaded avatars to their profiles before the upgrade? Any detail that you may provide us could be useful to trace how to reproduce this error and provide a solution.

As a temporal workaround (basically to avoid the awkward fatal error message in your site), you can do the following:

1. Open the file inc/users/model/_user.class.php
2. Replace the code from line 3625 to 3632 with this block:


			if( is_object($l_File) )
			{
				if( $l_File->is_image() )
				{
					if( $exclude_main_picture && $l_File->ID == $this->avatar_file_ID )
					{ // Exclude the main picture from list of other pictures
						continue;
					}
					$avatar_Links[] = $user_Link;
				}
			}

Regards!

3 Oct 03, 2014 04:15

Ok. I'm updating always from the same database since 2007. There is only 2-3 users who uploaded their photo.
I have for sure an error somewhere in my database, but I have no idea where. But it's not crucial for me, I think I will just use this workaround until I found the problem.
Thanks


Form is loading...