Gallery v1.4.4-RC2 and Mambo 4.5 problems

bworley61

Joined: 2003-11-05
Posts: 17
Posted: Tue, 2004-07-27 20:31

I have set up a test site to evaluate Mambo and Gallery. I followed all the instructions for installing Gallery configured as embedded in Mambo, and added Gallary as a Mambo component. URL is:

http://worleyworld.com/mos/

When I log into Mambo as Super Administrator (user: admin) and then attempt to add a photo to an album, or any other Gallery command that uses a popup window, I get the following message in the popup window:

"Gallery seems to be inside Mambo, but we couldnt get necessary infos"

I found the offending line in in /gallery/init.php:

/* Session infos about Mambo are available when we open a Popup from Mambo, 
** but content isnt parsed through Mambo
*/
if (isset($gallery->session->mambo)) {
   $mosConfig_host = $gallery->session->mambo->mosConfig_host;
   $mosConfig_user = $gallery->session->mambo->mosConfig_user;
   $mosConfig_password = $gallery->session->mambo->mosConfig_password;
   $mosConfig_db = $gallery->session->mambo->mosConfig_db;
   $mosConfig_dbprefix = $gallery->session->mambo->mosConfig_dbprefix;
   $MOS_GALLERY_PARAMS = $gallery->session->mambo->MOS_GALLERY_PARAMS;
}

if(empty($mosConfig_db)) {
   echo _("Gallery seems to be inside Mambo, but we couldnt get necessary infos.");
   exit;
}

Some additional information -- I installed Gallery in a subdirectory of
Mambo... so the mambo home page is:

/mos/index.php

Embedded gallery home directory is:

/mos/gallery/

Any help would be greatly appreciated....

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Wed, 2004-07-28 01:11

There was an issue with popups that is now fixed in what will be 1.4.4 Release. I can't replicate the issue you're seeing, however.

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Wed, 2004-07-28 13:38
signe wrote:
There was an issue with popups that is now fixed in what will be 1.4.4 Release. I can't replicate the issue you're seeing, however.

The problem appears to be where Gallery is attempting to load the configuration.php from Mambo in \gallery\contrib\mambo\classes\mambo.php:

/**
* Loads the configuration.php file and assigns values to the internal variable
* @param string The base path from which to load the configuration file
*/
function _setConfig( $basePath='.' ) {
  $this->_config = new stdClass();
  require( "$basePath/configuration.php" );
  $this->_config->offline = $mosConfig_offline;
  $this->_config->host = $mosConfig_host;
  $this->_config->user = $mosConfig_user;
  $this->_config->password = $mosConfig_password;
  $this->_config->db = $mosConfig_db;
  .
  .
  .
}

This load is failing for some reason.

Once again, I have installed Gallery in a subdirectory of Mambo at /mos/gallery/ - would this cause a problem ??

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Wed, 2004-07-28 14:28

I uninstalled and removed Gallery 1.4.4-RC3 and installed Gallery 1.4.3-pl2 ....

now the popups just come up blank, no error message but nothing else either.

FYI - when I log into Gallery outside of Mambo it works just fine, either version.

I need to get this online in a production site ASAP - any help would be appreciated.

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Fri, 2004-07-30 14:45

I just upgraded to the latest, v.1.4.4 -- and I get the SAME cryptic error message in popups while Gallery is embedded in Mambo:

Gallery seems to be inside Mambo, but we couldnt get necessary infos

FYI - PHP is setup with register_globals = On

Also - I just noticed, when I open an album the follow error appears at the bottom of the page:

Error: Requested index [0] out of bounds [1]

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Fri, 2004-07-30 18:33

Have you tried disabling register_globals? I can't think of a reason that it would cause this to fail, but it might....

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Fri, 2004-07-30 18:39

I added:

php_flag register_globals off

to .htaccess in /big/dom/.../www

Same results.

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Fri, 2004-07-30 19:13

I can't replicate this issue at all.... even with register_globals turned off.

Which revision of Mambo are you using? 4.5 (build number?) or 4.5.1

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Fri, 2004-07-30 19:28

RELEASE = 4.5
DEV_STATUS = Stable
DEV_LEVEL = 1.0.9
CODENAME = Spider
RELDATE = 28/06/2004
RELTIME = 16:51
RELTZ = GMT

 
askcharlie

Joined: 2003-11-11
Posts: 3
Posted: Sat, 2004-07-31 10:14

might sound strange and this is a shot in the dark, but seems like something worth trying that came to my mind...

have you tried temporarily changing to a different mambo theme? i'm not sure what you're using now, but maybe there's some code in there causing some issues. worth checking out.

 
Janner
Janner's picture

Joined: 2003-02-20
Posts: 3
Posted: Mon, 2004-08-02 10:24

Just to add a "me too!", although in my case this only seems to happen when I attempt to add a photo. All the other popups appear to work, and I'm not getting the error message at the bottom of the page that bworley61 mentions.

However, the photo upload works fine if I use the java applets, I only get this error when I try to use the form method of uploading.

This is using the latest stable release of Mambo (4.5.1.0.9) and the latest CVS build of Gallery (1.4.5.cvs.b81).

 
bworley61

Joined: 2003-11-05
Posts: 17
Posted: Mon, 2004-08-02 22:33

Just an update on my delima.. I've been trying to debug this thing, and with my limited knowledge of PHP I've determined that the the init.php class is successfully assigning config values into $gallery->session->mambo when not called from a popup, but will not populate $gallery->session->mambo when called from a Popup.

??

I'm going to have to go ahead and publish my website with mambo and gallery, and hope the enduser doesn't see a problem. I can still make updates from outside Mambo by logging into Gallery standalone. But it sure would be nice to get this problem resolved.

Thanks in advance,

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 22:41
Janner wrote:
Just to add a "me too!", although in my case this only seems to happen when I attempt to add a photo. All the other popups appear to work, and I'm not getting the error message at the bottom of the page that bworley61 mentions.

However, the photo upload works fine if I use the java applets, I only get this error when I try to use the form method of uploading.

This is using the latest stable release of Mambo (4.5.1.0.9) and the latest CVS build of Gallery (1.4.5.cvs.b81).

It's hardly a "me too" if you're not having the same issue.. ;)

What IS happening?

 
wayalive2

Joined: 2004-08-02
Posts: 4
Posted: Mon, 2004-08-02 22:43

Getting same error "Gallery seems to be inside Mambo, but we couldnt get necessary infos." But only with firefox / mozilla.

All seems to be working fine with IE...

HELP!

 
Janner
Janner's picture

Joined: 2003-02-20
Posts: 3
Posted: Tue, 2004-08-03 07:45
signe wrote:
Janner wrote:
Just to add a "me too!", although in my case this only seems to happen when I attempt to add a photo. All the other popups appear to work, and I'm not getting the error message at the bottom of the page that bworley61 mentions.

However, the photo upload works fine if I use the java applets, I only get this error when I try to use the form method of uploading.

This is using the latest stable release of Mambo (4.5.1.0.9) and the latest CVS build of Gallery (1.4.5.cvs.b81).

It's hardly a "me too" if you're not having the same issue.. ;)

It is if I am getting the same error message as the starter of this thread :P
Gallery seems to be inside Mambo, but we couldnt get necessary infos
As I said, the only difference is that it only happens when I try to use the form method to upload. The applets work fine.

 
patrickbronneberg
patrickbronneberg's picture

Joined: 2004-08-04
Posts: 2
Posted: Wed, 2004-08-04 12:03
Quote:
When I log into Mambo as Super Administrator (user: admin) and then attempt to add a photo to an album, or any other Gallery command that uses a popup window, I get the following message in the popup window:

"Gallery seems to be inside Mambo, but we couldnt get necessary infos"

I had the same problem. My gallery (1.4.4-debian1 in mambo 4.5 1.09) did work fine outside of mambo..

At my server the problem was caused by the URL to the gallery:
my site is at http://www.gagel.nl , and my gallery at http://gallery.gagel.nl . Apparently when using popups, the function makeGalleryUrl() changes the url to the gallery URL (so not some embedded www.gagel.nl/index.php?option=com_gallery url, but gallery.gagel.nl/[SomePHPFile].php). With the different domain for the gallery and the mambo site, the cookie and session were unreadable for the popup..

changing the gallery URL to http://www.gagel.nl/gallery fixed my problems. So maybe the solution to your problem could be to have the same URL as a basis for your gallery and your mambo site?

 
patrickbronneberg
patrickbronneberg's picture

Joined: 2004-08-04
Posts: 2
Posted: Wed, 2004-08-04 12:11

Oh and a bit off topic, but:
I changed the function makeGalleryUrl() a bit to prevent headers, footers and menu to appear in editing popups (the ones you get when selecting image options instead of album options). Because these url's do not contain the type=popup parameter.. My fix for this:

util.php line 1393

case 'mambo':
				$args['option'] = $GALLERY_MODULENAME;
				$args['Itemid'] = $MOS_GALLERY_PARAMS['itemid'];
				$args['include'] = $target;

				/* We cant/wantTo load the complete Mambo Environment into the pop up
				** E.g. the Upload Framwork does not work then
				** So we need to put necessary infos of Mambo into session.
				*/
				
				switch($target)
				{
					case 'edit_caption.php':
						$mamboPopup = true;
					break;	
					case 'edit_thumb.php':
						$mamboPopup = true;
					break;	
					case 'rotate_photo.php':
						$mamboPopup = true;
					break;	
					case 'move_photo.php':
						$mamboPopup = true;
					break;	
					case 'copy_photo.php':
						$mamboPopup = true;
					break;	
					case 'delete_photo.php':
						$mamboPopup = true;
					break;	
					case 'photo_owner.php':
						$mamboPopup = true;
					break;
					case 'edit_field.php':
						$mamboPopup = true;
					break;	
					case 'rename_album.php':
						$mamboPopup = true;
					break;	
					case 'album_permissions.php':
						$mamboPopup = true;
					break;
					case 'view_album.php':
						$mamboPopup = false;
					break;		
					default:
					  $mamboPopup = false;
					break;
				}	
				
				/* We cant/wantTo load the complete Mambo Environment into the pop up
				** E.g. the Upload Framwork does not work then
				** So we need to put necessary infos of Mambo into session.
				*/
				
				if ((isset($args['type']) && $args['type'] == 'popup')) {
					if ($target='add_photos_frame.php') {$target= $gallery->app->photoAlbumURL . "/index.php";}
					else {$target= "index2.php";}
					if(!isset($gallery->session->mambo)) {
						$gallery->session->mambo->mosConfig_host=$mosConfig_host;
		                	        $gallery->session->mambo->mosConfig_user=$mosConfig_user;
	        	        	        $gallery->session->mambo->mosConfig_password=$mosConfig_password;
	                		        $gallery->session->mambo->mosConfig_db=$mosConfig_db;
	                		        $gallery->session->mambo->mosConfig_dbprefix=$mosConfig_dbprefix;
		                	        $gallery->session->mambo->MOS_GALLERY_PARAMS = $MOS_GALLERY_PARAMS;
					}
				} else {
					if ($mamboPopup){$target = 'http://www.gagel.nl/index2.php';}
					else {$target = 'index.php';}
				}

			break;
 
PvVoorst
PvVoorst's picture

Joined: 2003-01-26
Posts: 9
Posted: Mon, 2004-09-20 23:02

Hmm, nice try. But it didn't fix anything at my site...

Is there anyway to "hack" that popup and feed it with the necesary info?
I know that's not the way it should be, but hey, if it fixes that problem!

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-09-20 23:15

I've started using Mambo on a personal site and have done a LOT of tweaking to make 1.4.5 completely Mambo-compliant. To my knowledge, the code in CVS has no remaining issues with popups.

Sadly, there's no easy way to back-port these fixes to make available in 1.4.4 - they're fairly extensive and cover a lot of different places in the codebase.

The hack above probably will not work, since it fails to set the necessary information used by Gallery (the large 'gallery->session->mambo' block, immediately above).

 
PvVoorst
PvVoorst's picture

Joined: 2003-01-26
Posts: 9
Posted: Mon, 2004-09-20 23:28

Signe,

Thanks for the quick reply. I'ts good to know where dead ends are...

Testing with the register_globals didn't do anything as you mentioned before :-(

So, stuck with doing the foto-management outside mambo... :cry: