updateUser - ERROR_MISSING_OBJECT

Sunbeam25
Sunbeam25's picture

Joined: 2007-03-24
Posts: 34
Posted: Fri, 2007-12-28 17:02

Hi All

Gallery 2.3.3, I'm getting the following error for one of my users. Any ideas?

I'm running an updateUser to correct this user's password (hashed from vBulletin). For another user, the code worked, for this user it failed.

Do the classes in the error message suggest what is missing?

Thanks

Alan

line: 90, Failed to update G2 user with extId [21]. Here is the error message from G2:
Error (ERROR_MISSING_OBJECT, ERROR_UNKNOWN) : Missing object for 3415
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2075 (gallerycoreapi::error)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (gallerystorageextras::_identifyentities)
in modules/core/classes/GalleryStorage.class at line 298 (gallerystorageextras::loadentities)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (mysqlstorage::loadentities)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 127 (galleryentityhelper_simple::loadentitiesbyid)
in modules/core/classes/GalleryCoreApi.class at line 2298 (galleryentityhelper_simple::loadentitybyexternalid)
in modules/core/classes/GalleryEmbed.class at line 375 (gallerycoreapi::loadentitybyexternalid)
in /home/sites/stdregisterforum.org.uk/public_html/gallery2.php at line 88 (galleryembed::updateuser)
in /home/sites/stdregisterforum.org.uk/public_html/gallery2.php at line 50

 
chrisfx

Joined: 2008-01-16
Posts: 5
Posted: Wed, 2008-01-16 22:11

I had the same problem. This is likely caused by your external mapping id's getting out of whack. Log into the database and view the records in the g2_externalidmap table. In my case, the external id was pointing at an invalid (deleted) entity id.

I'd recommend:
1. Write down all the user details
2. Delete the user using the Gallery GUI
3. Check if the user still exists in g2_externalidmap and then delete it (make sure you have a db backup first!)
4. Create the user again using the Gallery GUI

There may be another way to do this but as far as I can see the GalleryEmbed class does not cater for this.

 
chrisfx

Joined: 2008-01-16
Posts: 5
Posted: Wed, 2008-01-16 22:26

Just found this - much safer than deleting records from the database:

GalleryCoreApi::removeMapEntry('ExternalIdMap', array('externalId' => $id, 'entityType' => 'GalleryUser'));

 
Sunbeam25
Sunbeam25's picture

Joined: 2007-03-24
Posts: 34
Posted: Thu, 2008-01-17 09:49

Thanks, I'll have a look and let you know how I get on!