error GALLERY_SUCCESS while embedded solution

JMPZ

Joined: 2005-08-27
Posts: 2
Posted: Sat, 2005-08-27 01:37

I've notice that a few people have had the gallery_success error message when embedding gallery. I recently had this problem, and it looks like it's a bug that's causing it.

It happens when you delete a user in gallery, then that user tries to access gallery again.
You get the following message at the top of the page:

<HR>line: 107, G2 did not return a success status. Here is the error message from G2: <br />Error  (GALLERY_SUCCESS)<ul><li><b>in</b>  <b>at line</b> 0</ul>

The problem is that gallery doesn't delete the corresponding record in the g2_ExternalIdMap table, so the external userid is mapped to a non-existant internal id.

The solution is to go into the database and delete the offending row, however in the future I believe that the script to delete users should update this table as well.

Btw, thanks for all your hard work guys, this product is amazing!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-08-27 03:45

so you don't use GalleryEmbed::deleteUser to delete the user but site admin -> users: delete?
sure we could change the g2 code to check if an entry in the externalIdMap exists, but usually, i'd expect that users aren't deleted with G2's UI when embedded, but in the other application which then calls GalleryEmbed::deleteUser().

 
JMPZ

Joined: 2005-08-27
Posts: 2
Posted: Sat, 2005-08-27 14:01

I'm using vbulletin 3, and the current integration doesn't modify vb at all. The users are created when they go into the gallery, and removal will have to be manual. At present, I'm not modifying vb any more until we upgrade to 3.5.

Anyhoo, it can help any other people having the same problem I suppose.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-08-28 01:04

so the current way to delete a user in g2 / vb3 is to delete it in vb3 and g2 separately?
in other integrations, the integration code deletes the user automatically in g2 when you delete it in the other application...

 
SilVert

Joined: 2006-03-12
Posts: 9
Posted: Tue, 2006-03-14 19:39

correct Valiant

the error:
line: 107, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0

The integration script creates a user. To delete the user, you need to jump into the G2 admin panel and remove the user. which i have done for testing. but now i get this error.

In all my testing i have used the integration script to create the user 5 or 6 times and now all the sudden i am getting this exact error. the integration script dosent display G2 anymore when it displays the error, it just displays the vb3 skin with no content.

p.s. just incase anybody was wondering, the integration script does work on vb 3.5

 
Garbor

Joined: 2006-05-09
Posts: 1
Posted: Tue, 2006-05-09 13:50

I found this issue also while trying to build an integration of G2 into e107.
Shure i will implement the call to deleteUser, but you can never be shure a user will not be deleted in the g2admin.

It would be a cleaner design when G2 cleans up references when deleting a user.

Except when there is no way to remove the id over the plugin interface, deleteUser fails in this case.

Garbor

 
mattynuke

Joined: 2006-05-31
Posts: 7
Posted: Wed, 2006-05-31 15:20

I am having this problem without ever having deleted any users. I did the install and tried to embed g2, and immediately got this problem. The only user is the admin, which I have never tried to delete.

 
joelfarris
joelfarris's picture

Joined: 2006-02-20
Posts: 15
Posted: Sun, 2006-06-04 23:54

I just experienced the same problem as mattynuke. That is to say, I installed and configured g2, added one additional user via the Site Admin control panel, then found out that I could embed g2 into a personal website without having to customize miles of Smarty template. Great, I thought!

So I followed the embed instructions found at http://gallery.menalto.com/node/36918, and it didn't work. I tried deleting my newly created user as JMPZ suggests earier in this thread. Still nothing! I too, am seeing the

Error (GALLERY_SUCCESS)

* in at line 0

problem. It prints out at the top of every one of the pages. I can't figure out why I'm so close to achieving nirvana, and yet I can't get rid of this one little error. If I could just get this problem to go away, I'd have a fully functioning photo gallery within a website that didn't rely on some template. Here, have a look for yourself:

http://kirstendavies.com/gallery2embedded.php

Can anybody shed a light onto this issue for me? At least give me an idea to try!
--
Joel Farris
"And that's the way it oughta be!"

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7939
Posted: Mon, 2006-06-05 01:54

Not knowing what code you are trying....
Try this:

<?php 
$g2_Config['path'] = dirname(__FILE__) . '/';
$g2_Config['embedPath'] = '';
$g2_Config['g2Uri'] = '/gallery2/';
$g2_Config['loginredirect'] = '/';
$g2_Config['embedUri'] = '/gallery2/galleryembed.php?';
require_once( $g2_Config['path'] . 'embed.php');
$ret = GalleryEmbed::init(array( 'g2Uri' => $g2_Config['g2Uri'], 'loginRedirect' => $g2_Config['loginredirect'], 'embedUri' => $g2_Config['embedUri'], 'fullInit' =>'false'));
	 if ( $ret )
    {
	    echo( '   Here is the error message from G2:' );
	    echo( $ret->getAsText() );
	    return false;
     }
GalleryCapabilities::set('login',true);
$g2moddata = GalleryEmbed::handleRequest();
    if (!isset($g2moddata['isDone'])) { 
        echo ('isDone is not defined, something very bad must have happened.'); 
		exit; 
	}
    if ($g2moddata['isDone']) { 
		exit; /* uploads module does this too */ 
	}
	if ($ret) { 
		print $ret->getAsHtml(); 
	} 
GalleryEmbed::done(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<?php echo $g2moddata['headHtml']; 
//$headHtml = str_ireplace('<title>', ' -- ' . 'My Site' . '</title>', $headHtml);
 echo $headHtml; 
 ?>
<style type="text/css">My style sheet here</style>
</head>

<body class="gallery">
<p>My Site Header Here</p>
<?php
echo $g2moddata['bodyHtml']; 
?>
<p>My Site Footer Here</p>
</body>

</html>

Put this code into another page - like galleryembed.php or something. If it works try it in your gallery2embedded.php page.

Hope this helps :)

-s

Hope this helps.

 
joelfarris
joelfarris's picture

Joined: 2006-02-20
Posts: 15
Posted: Mon, 2006-06-05 03:24

Thanks for taking the time to reply. I tried your code by copy/pasting it into a new php doc, and then uploading that to my server. I tried placing the new file in the /gallery2 directory, and also tried it directly in the / directory.

No dice. The error still comes up the same. I sure wish i could figure out what's causing the problem. This site needs a photo gallery, and I can't seem to figure this little error out!
--
Joel Farris
"And that's the way it oughta be!"

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7939
Posted: Mon, 2006-06-05 03:43

try setting debug on in gallery2/config.php around line 118 $gallery->setDebug('buffered');

to see what errors are occurring.

-s

 
joelfarris
joelfarris's picture

Joined: 2006-02-20
Posts: 15
Posted: Mon, 2006-06-05 06:36

I did as you said, yet g2 didn't output anything that I could see. Probably relating to the highly customized smarty template I've been working on. I bet I deleted the part where g2 gets to output it's buffered error stuff. So I switched the setDebug to 'immediate', and here's what I got:

(mysql): SELECT g2_DerivativePrefsMap.g_order, g2_DerivativePrefsMap.g_derivativeType, g2_DerivativePrefsMap.g_derivativeOperations FROM g2_DerivativePrefsMap WHERE g2_DerivativePrefsMap.g_itemId = 7 ORDER BY g2_DerivativePrefsMap.g_order ASC file_exists(/usr/local/4admin/apache/vhosts/kirstendavies.com/httpdocs/gallery2/modules/core/classes/helpers/../../../../modules/icons/classes/IconsImpl.class) getParameter iconpack for icons plugin file_exists(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/cache/module/icons/0/0/0.inc) file_exists(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/smarty/templates_c/%%955857950) is_dir(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/smarty/templates_c/%%955857950) file_exists(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/smarty/templates_c/%%955857950) is_writeable(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/smarty/templates_c/%%955857950) file_exists(/usr/local/4admin/apache/vhosts/kirstendavies.com/storage/gallery2Data/smarty/templates_c/%%955857950/v_8) realpath(/usr/local/4admin/apache/vhosts/kirstendavies.com/httpdocs/gallery2/modules/core/classes/../../../) Error (GALLERY_SUCCESS)

* in at line 0

Does this make any sense to you? It doesn't seem to follow the O.P.'s initial comment at the top of this thread.
--
Joel Farris
"And that's the way it oughta be!"

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7939
Posted: Mon, 2006-06-05 11:28

It does seem to be non-specific doesn't it.
Why don't you try a different non-editted theme, and see if you still get the error with galleryembedded.php

-s

 
digix

Joined: 2006-07-18
Posts: 2
Posted: Tue, 2006-07-18 21:58

Any updates on this? I am having the same issues as mattynuke & joelfarris with a fresh install of gallery and attempting to embed into a simple site.

It doesn't matter what theme I use, it gives me the same error every time I try to access the embedded page....

Error (GALLERY_SUCCESS)

* in at line 0

EDIT: here is the info from maintenance -> system information:

Gallery version = 2.0.1 core 1.0.0.1
PHP version = 4.3.11 cgi-fcgi
Webserver = Apache/1.3.33 (Unix) FrontPage/5.0.2.2510 mod_fastcgi/2.4.2
Database = mysql 4.1.14
Toolkits = Exif, NetPBM, Gd
Operating system = FreeBSD hostingprod.com 4.11-YAHOO-20051118 FreeBSD 4.11-YAHOO-20051118 #0: i386
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1

and I can post my gallery.php code if needed.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2006-07-19 01:06

please use G2.1, we'd like to move all integrations to g2.1.

 
digix

Joined: 2006-07-18
Posts: 2
Posted: Wed, 2006-07-19 16:54

ok, so yeah, it was Yahoo's little script that was screwing me over.... I got it all updated and it seems to embed now, but its not accepting my relative paths for the gallery directory, so the theme is all screwed up. Any ideas? Edit: I fixed it...

Thanks in advance.

-Digix

 
shawnboy

Joined: 2007-05-28
Posts: 4
Posted: Mon, 2007-05-28 17:25

I'm having the exact same problem... Yahoo! is my host. You mention Yahoo!'s "little script" and you "got it all updated and it seems to embed now." Could you share the wisdom of how to fix this? I've looked all around the Site Admin for anything to do with updating and didn't see anything. What and how do I update to fix this problem on my Yahoo! hosted gallery?

Gallery version = 2.0.1 core 1.0.0.1
PHP version = 4.3.11 cgi-fcgi
Webserver = Apache/1.3.33 (Unix) FrontPage/5.0.2.2510 mod_fastcgi/2.4.2
Database = mysql 4.1.14
Toolkits = Exif, NetPBM, Gd
Operating system = FreeBSD hostingprod.com 4.11-YAHOO-20051118 FreeBSD 4.11-YAHOO-20051118 #0: i386
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

-shawnboy

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-05-28 18:16