Missing argument 2 for GalleryCoreApi::addMapEntry()

cosmicelf

Joined: 2005-08-21
Posts: 153
Posted: Thu, 2006-11-16 02:38

I'm sure this has something do do with the API updates...
But could someone tell me how to fix this?

$ret = GalleryCoreApi::addMapEntry(array('externalId' => $eventId,
	     'entityType' => 'GalleryAlbumItem', 'entityId' => $album->getId()));
	if ($ret) {
	   return $ret->wrap(__FILE__, __LINE__);
	}
	
	GalleryEmbed::done();
	
	return GalleryStatus::success();

The error I get is this...

Warning: Missing argument 2 for GalleryCoreApi::addMapEntry(), 
called in /website/gallery/createEventsGallery.php on line 85 
and defined in /website/phpgallery/modules/core/classes/GalleryCoreApi.class on line 2919

seems this is the last thing broken since my upgrade.

I found this page..

http://gallery.menalto.com/apidoc/GalleryCore/Classes/GalleryCoreApi.html#methodaddMapEntry

seems I am missing the first argument $mapname..

how do I know what mapname to use?

thanks!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2006-11-16 03:23

I guess you're confusing GalleryEmbed::addExternalIdMapEntry() with GalleryCoreApi::addMapEntry().

 
cosmicelf

Joined: 2005-08-21
Posts: 153
Posted: Thu, 2006-11-16 05:18

oh really? can I do one of these :

$ret = GalleryCoreApi::addMapEntry("ExternalIdMap",array('externalId' => $eventId,
'entityType' => 'GalleryAlbumItem', 'entityId' => $album->getId()));

or should I be using GalleryEmbed::addExternalIdMapEntry()

 
cosmicelf

Joined: 2005-08-21
Posts: 153
Posted: Sun, 2006-11-26 18:37

Is this:

$ret = GalleryCoreApi::addMapEntry("ExternalIdMap",array('externalId' => $eventId,
'entityType' => 'GalleryAlbumItem', 'entityId' => $album->getId()));

the same as using:

GalleryEmbed::addExternalIdMapEntry()

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2006-11-26 18:53

the result is the same yes.

but there's a point in having a versioned API for embedding. you should check the API version when using it.
if you're also using the core API, you need to check the core API version as well.

else you're application is prone to version mismatches and related errors when you update your g2.

 
cosmicelf

Joined: 2005-08-21
Posts: 153
Posted: Sun, 2006-11-26 21:53

oh good.. thanks you.

just wanted to make sure they would be saving to the same table if some scripts use on and possibly some use the others.

what is the best method of checking these versions?

what am i looking for?