Drupal 4.6 intergrating with G2 (or a lack there of)

griffon

Joined: 2005-08-18
Posts: 13
Posted: Thu, 2005-08-18 17:03

I posted this over at drupal.org but I thought I would ask if anyone has fix here. Kind of looks like the module is not being worked on real activily (just going from the number of bugs posted).

Gallery2 works stand alone drupal works stand alone. When useing gallery2 embed module things start going wrong.

warning: _gallery_init(gallerey2//embed.php): failed to open stream: No such file or directory in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 235.
warning: _gallery_init(): Failed opening 'gallerey2//embed.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 235.

Fatal error: Undefined class name 'galleryembed' in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 251

If I really mess around with it I can get to go to a page not found instead of the error :p.

If somebody has a step through of how to get this to work that is a little more insightful then the install doc that might be handy. If I'm doing something wrong it s entirely unclear to me what, and I have spent a lot of time poking at this.

thanks

-Griffon

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Thu, 2005-08-18 20:06

I have sucessfully gotten G2 and Drupal to work together but it took a while looking thru a bunch of posts here and at drupal.org to get everything working. I have attached my integration module. You also have to add a line in main.php for everything to work.

After these two lines in main.php

$data = $theme->splitHtml($html, $results);
$data['isDone'] = false;

You need to add

$data['themeData'] =& $template->getVariableByReference('theme');

I have submitted an Feature Request here to come up with a way to add this without having to modify main.php since that file gets overwritten everytime you upgrade.

Another thing to note is that I have seen that this site is going to be a drupal site soon so I would guess that this will get fixed sooner rather then later.

If this doesn't work for you please reply back and let me know the paths to both drupal and g2. On my site drupal is installed in the web server root and gallery is in a gallery2 folder.

 
griffon

Joined: 2005-08-18
Posts: 13
Posted: Thu, 2005-08-18 20:56

Thanks for the help, sadly I didn't see it make a difference. I added the line to main.php and uploaded your gallery module.

The drupal site is just off of root
www.walkerpad.com/testsite
www.walkerpad.com/testsite/gallery2

edit: fixed bad link
-Griffon

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Thu, 2005-08-18 21:13

Interesting.

Did you enable the two blocks that the gallery module creates?

When I try to goto www.walkerpad.com/testsite/index.php?q=gallery
in Firefox it does nothing and in IE it gives me a DNS error. Weird. You might want to look in the drupal logs and let me know if there are any errors.

 
griffon

Joined: 2005-08-18
Posts: 13
Posted: Thu, 2005-08-18 23:51

Yep I enabled the navigation block and set a gallery link in the menu.

I had a typo in the above link, it's www.walkerpad.com/testsite/gallery2

but that returns a blank or error even though everthing appears to be correct path wise. gallery2/
If I change the path to pretty much anythign else like ../gallery2/ I start seeing

warning: _gallery_init(../gallery2//embed.php): failed to open stream: No such file or directory in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 241.
warning: _gallery_init(): Failed opening '../gallery2//embed.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 241.

Fatal error: Undefined class name 'galleryembed' in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 261

If I try a full path such as
/httpdocs/testsite/gallery2/
I start seeing

warning: _gallery_init(): open_basedir restriction in effect. File(/httpdocs/testsite/gallery2//embed.php) is not within the allowed path(s): (/home/httpd/vhosts/walkerpad.com/httpdocs:/) in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 241.
warning: _gallery_init(/httpdocs/testsite/gallery2//embed.php): failed to open stream: Operation not permitted in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 241.
warning: _gallery_init(): Failed opening '/httpdocs/testsite/gallery2//embed.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 241.

Fatal error: Undefined class name 'galleryembed' in /home/httpd/vhosts/walkerpad.com/httpdocs/testsite/modules/gallery.module on line 261

But at this point I don't beleive it's a path issue since gallery2/ "should" work as far as I can tell

Thanks

-Griffon

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Fri, 2005-08-19 18:42

Did you try
/httpdocs/testsite/gallery2
or
/home/httpd/vhosts/walkerpad.com/httpdocs/testsite/gallery2
or just
gallery2 with no trialing slash

Mine is gallery2/ but I'm using it on Windows 2003 and IIS not Apache.

The other thing to try is turning off clean urls in Drupal and the mod rewrite module in G2 and see if that works. When you do that the link to the embed g2 will be
http://www.walkerpad.com/testsite/index.php?q=gallery

 
davidwagner

Joined: 2005-06-08
Posts: 6
Posted: Sat, 2005-08-20 19:50

i am having exactly the same problems...
i tried a lot, with a lot of solutions on druipal.org etc...
and now my gallery works with the "?=gallery" ending
but the navigation block is not shown. and when i log in and change to another site on the gallery i always get logout out....
do you know something?

 
griffon

Joined: 2005-08-18
Posts: 13
Posted: Sun, 2005-08-21 03:45

Hey David how did you get the ?=gallery to work?
I either get a page not found or the error message depending on the pathing ../ = error and gallery2/ is paged not found.

Frustrating. I may have to just stick with G1.5 and post nuke, this is just not coming together very well. Seems like a lot of the drupal modules suffer from pathing and other bugs.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Sun, 2005-08-21 03:58

Davidwagner, Did you make the change to main.php in G2. I had the same thing with the navigation block that you did, but I found a post a page or so back that helped me fix it. I attached the module that I made three changes to and now everything works.

As to you griffon I'm sorry I've run out of ideas. You might want to look in the webserver logs to see if something is happening.

 
davidwagner

Joined: 2005-06-08
Posts: 6
Posted: Sun, 2005-08-21 11:33

@griffon...
i only used drupal 4.6 thats it

@lvthunder
thanks a lot. i'm going to test it now. only small changes to main.php and replacing the gallery module... something else to do?

all the best

david

 
davidwagner

Joined: 2005-06-08
Posts: 6
Posted: Sun, 2005-08-21 12:05
lvthunder wrote:
I have sucessfully gotten G2 and Drupal to work together but it took a while looking thru a bunch of posts here and at drupal.org to get everything working. I have attached my integration module. You also have to add a line in main.php for everything to work.

After these two lines in main.php

$data = $theme->splitHtml($html, $results);
$data['isDone'] = false;

You need to add

$data['themeData'] =& $template->getVariableByReference('theme');

I have submitted an Feature Request here to come up with a way to add this without having to modify main.php since that file gets overwritten everytime you upgrade.

Another thing to note is that I have seen that this site is going to be a drupal site soon so I would guess that this will get fixed sooner rather then later.

If this doesn't work for you please reply back and let me know the paths to both drupal and g2. On my site drupal is installed in the web server root and gallery is in a gallery2 folder.

Hi in my main.php there are no such lines...
where do i find them?

 
davidwagner

Joined: 2005-06-08
Posts: 6
Posted: Sun, 2005-08-21 16:47

ok i found it and changed it and replaced the gallery module....

nothing worked....

with and without your modification i can open the gallery by
?=gallery

BUT:
i always get logged and when open a admin site AND no navigation is shown (to administer the gallery)

do you know why?
thanks
david

 
griffon

Joined: 2005-08-18
Posts: 13
Posted: Mon, 2005-08-22 01:43
lvthunder wrote:
Davidwagner, Did you make the change to main.php in G2. I had the same thing with the navigation block that you did, but I found a post a page or so back that helped me fix it. I attached the module that I made three changes to and now everything works.

As to you griffon I'm sorry I've run out of ideas. You might want to look in the webserver logs to see if something is happening.

Bummer, thanks anyway. I don't have direct access to the server logs but I'll bug the suport folks about it.

Hopefully at some point a more stable/usable version of the module will come out, right now it's way to much black magic to get what should be simple up and running.

-Griffon

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Mon, 2005-08-22 01:52

I've never got logged out when viewing any of the pages, but I think I read either here or on drupal.org that some people were. Since I wasn't one of them I didn't bother reading up about it.

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Thu, 2005-10-13 02:48

I just registered just so I could post a 'Thank You' to you lvthunder... the g2 module available here was driving me nuts, and the sidebar wouldn't show up when gallery pages were visible.

Your module worked perfectly.

However, one thing you should mention is that if a user installs your module, they will have to reconfigure their image block settings. I failed to do this at first, and simply replaced the gallery.module with yours, activated both blocks, and then tore my hair out some more because now the sidebar was showing up, but the random image wasn't.

Once I logged into administer, and saw my error log, I figured out that the gallery image block settings weren't set, and once I took care of that, everything is hunky dory.

I'm currently setting up my own site, and after fighting with Mambo, then Joomla, then Post-Nuke and PHP-Nuke, I settled on Drupal. Right now Mambo is a mess when it comes to G2 integration (no user sync? c'mon!), Joomla has problems of it's own (I couldn't get any of the 'Special' class items to show up when an admin was logged in), Post-Nuke isn't too bad, but is slow, and PHP-Nuke is also a bear of a CMS.

Drupal seems to be where it's at... I see that this site has upgraded to Drupal... I wonder if they're working on an updated module?

Thanks again.

 
dnuttall

Joined: 2004-04-02
Posts: 3
Posted: Fri, 2005-10-14 17:50

I've tried to faithfully follow this thread w/special attention to the added line to main.php.

My Drupal 4.6.3 with Gallery 2.0.1 runs as $HOME/gallery2 and the Drupal menu item correctly calls the $HOME/gallery2/main.php.

What I can't seem to extract is how to get Drupal to just display the gallery and maintain its Drupal header/navigation.

If anybody can point to the (probably) obvious oversight on my part, I'd be publically grateful as needed!!

PM me for the URL, since I'm not sure I want to publish the URL just yet.

TIA.
Dave Nuttall
San Antonio, Texas

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Fri, 2005-10-14 18:18

So does it display the embedded gallery? From your post I can't specifically gather what question you're asking...

Do you basically want Gallery2 with the Drupal header substituted in? I think you'd just have to call the functions to include the Drupal classes, then the one to call the drupal header in the Gallery2 code, and comment out the lines that display Gallery2's header.

Once again, I'm not sure if that's what you mean... if in fact you're having embedding problems, one thing to check also, is go into gallery standalone (http://www.yoursite.com/gallery2/), and go to Site Admin > URL Rewrite, and turn all the options 'off'. If you're having embedding problems, or if it's simply calling up the Gallery2 site outside of Drupal, that could be the problem... mod_rewrite is just doing exactly what it's supposed to. ;)

You may also want to uncheck 'Clean URL's' in Drupal, under the main Settings menu in Administer... I'm still having a heck of a time with those too. That could also help.

Good luck.

 
dnuttall

Joined: 2004-04-02
Posts: 3
Posted: Fri, 2005-10-14 19:47

I got it to work!
I want/wanted it to resolve within the Drupal "frame" (I know its really NOT a frame, but the content area of the screen compared to the header & navigation). When I called it from the Navigation menu item, it displayed full screen instead of what I guess is rightfully called "embedded".

So, as the prior post (graffixjones) suggested, I turned OFF the URL rewrite in the Gallery site admin.
That did NOT solve it.

So I unset/unchecked the 'Clearn URLs' in Drupal and "voila" worked like a charm. I should be in politics being able to do such magic!

Thanks gaffixjones.
d.

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Fri, 2005-10-14 19:56

No problemo. :)
You'll find that trying to get mod_rewrite to play nice when you have a CMS that supports short URL's, and a module that supports short URL's is an exercise in futility. :D

Glad you got it to work.
D.

 
karunaworks

Joined: 2005-10-15
Posts: 1
Posted: Sat, 2005-10-15 10:12

Gallery 2 and Drupal 4.6 both have both installed and work seperately. There was no problem in the installation. However when I enabled the block I get the following error and the gallery module in drupal is not enabled:

details
Type gallery
Date Friday, October 14, 2005 - 10:55
User karunaworks
Location /?q=user/login&destination=node%2F1
Message Unable to log in to Gallery
Error (ERROR_MISSING_OBJECT)

* in modules/core/classes/helpers/GalleryUserHelper_medium.class at line 179 (gallerystatus::error)
* in modules/core/classes/GalleryCoreApi.class at line 506 (galleryuserhelper_medium::fetchuserbyusername)
* in /var/www/html/modules/gallery/gallery.module at line 345 (gallerycoreapi::fetchuserbyusername)
* in /var/www/html/modules/gallery/gallery.module at line 51
* in /var/www/html/modules/user.module at line 19
* in /var/www/html/modules/user.module at line 814
* in /var/www/html/modules/user.module at line 1232
* in ??? at line 0
* in /var/www/html/includes/menu.inc at line 354
* in /var/www/html/index.php at line 18

Kiz asked me to check if a new user was created in Gallery 2 when I created a new user in drupal. I checked and found that a new user is NOT created in gallery 2, when i create a new user in drupal.

What am I doing wrong? How do I get this to work?

Arjun

 
bluefin
bluefin's picture

Joined: 2003-10-02
Posts: 9
Posted: Sun, 2005-10-16 00:53

Similar to karunaworks posting above, I've got some integration/embedding issues as well. Here's the environment:

Gallery version = 2.0.1 core 1.0.0.1
PHP version = 4.3.10 apache2handler
Webserver = Apache/2.0.52 (Fedora)
Database = mysqlt 3.23.58
Toolkits = ArchiveUpload, Exif, Gd, NetPBM, Thumbnail, ImageMagick
Operating system = Linux mandrin.tuna.org 2.6.10-1.741_FC3smp #1 SMP Thu Jan 13 16:53:16 EST 2005 i686
Browser = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050927 Fedora/1.0.7-2.1.fc4.nr Firefox/1.0.7

URL/Directories of note:
/data/web/wicked/public is the base Drupal install (everything below is relative to this)
/gallery2 is the gallery 2.0.1 install

I installed the latest gallery.module (4.6-compatible release is from 15/Sep/2005).

My gallery installation works just fine standalone.
My gallery installation works jsut fine embedded.

EXCEPT: All of the URL strings are the horrifying, terrifyingly grotesque form of:
http://www.wickedar.com/gallery?g2_view=core%3AShowItem&g2_itemId=365

The shortened/clean URL strings don't work, they evoke an error message:
(example URL: http://www.wickedar.com/gallery/v/2005-Wicked_ASS/ )

Quote:
Error (ERROR_MISSING_OBJECT, ERROR_UNKNOWN) : Parent 7 path v

* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 118 (gallerystatus::error)
* in modules/core/classes/GalleryCoreApi.class at line 1762 (galleryfilesystementityhelper_simple::fetchchildidbypathcomponent)
* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 63 (gallerycoreapi::fetchchildidbypathcomponent)
* in modules/core/classes/GalleryCoreApi.class at line 1708 (galleryfilesystementityhelper_simple::fetchitemidbypath)
* in modules/core/classes/GalleryView.class at line 344 (gallerycoreapi::fetchitemidbypath)
* in modules/core/classes/GalleryView.class at line 219 (showitemview::_getitem)
* in main.php at line 287 (showitemview::doloadtemplate)
* in main.php at line 87
* in modules/core/classes/GalleryEmbed.class at line 153
* in /data/web/wicked/public/modules/gallery/gallery.module at line 276 (galleryembed::handlerequest)
* in ??? at line 0
* in /data/web/wicked/public/includes/menu.inc at line 354
* in /data/web/wicked/public/index.php at line 18

The Gallery rewrite module is installed, and the "test" all report successful. I get the same errors when I also try and install the flaturl gallery module.

Any thoughts on this issue? I really despise those nasty long URLs, and would like to have simple clean URLs working. I know it's got to work - since the gallery.menalto.com website seems to have it working fine in operation.

TIA.

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Sun, 2005-10-16 01:42

karunaworks:
I'm not sure what's going on, but for some reason you're having some user mapping issues. Are your Gallery administrator and your Drupal administrator the same username? You'll only get new user creation in gallery2 once the module is loaded, so if your module isn't loading, you're not going to get synced users when you create a new Drupal user.

bluefin:
Even though your clean url tests 'pass' the test, you'll still run into problems because gallery2 and Drupal both use different rules for mod_rewrite. I also passed the tests within the embedded gallery2 installation, but still had the same problem you're having until I turned all url rewrite rules off (and clean url's in Drupal). The problem is that gallery2 is being passed a path from Drupal that isn't valid, which is why it doesn't know what the heck to do. Drupal is sending it a relative path based on it's clean url's, and gallery2 is handling it based on it's own ruleset, which isn't working because it's based off the path that Drupal is sending... at least that's what I've gathered from playing around with both for the past couple weeks.

HTH

 
kiz_0987

Joined: 2005-02-27
Posts: 189
Posted: Sun, 2005-10-16 02:07

bluefin: Your G2 URL Rewrite settings are incorrect for Drupal embedding. See the INSTALL.txt file for instructions, or http://codex.gallery2.org/index.php/Gallery2:How_to_Embed_Gallery2_in_Drupal#URL_Rewrite.

Basically, you need to change the settings (as described) and make sure you only use the rule for "Show Item".

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Sun, 2005-10-16 18:12

I discovered something with the hook_search function in the gallery2 component (lvthunder's)... it doesn't generate valid url's when searching. In one spot, rather than putting '&' into the url, it puts '&', which causes the url to fail. Changing it back to '&' in the address bar fixes the problem.
I've looked through the module code, and it appears that it's using the generateURL() function to generate the url from the associative array key, but I don't know what to do to fix it.

 
kiz_0987

Joined: 2005-02-27
Posts: 189
Posted: Sun, 2005-10-16 19:27

This has been reported in http://gallery.menalto.com/node/38221, unfortunately without resolution. On my installation it works perfectly, and the Drupal code just calls the URL generator so as far as I can work out is not doing anything to cause this.

What happens if you do a search in G2 (non-embedded)?

Perhaps add your info to the link above rather than complicate this thread with additional problems.

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Sun, 2005-10-16 19:39

Complicate this thread with additional problems?

I was under the impression that this thread dealt with Gallery2->Drupal integration... and since this problem directly deals with said integration, I figured it was a valid subject to post here.

I apologize if I was mistaken... apparently you know more about how this particular thread is supposed to work than I do...

To answer your question, searching Gallery2 standalone works fine, it's just when the url is fed back using the generateURL() function that it seems to have problems in Drupal.

 
kiz_0987

Joined: 2005-02-27
Posts: 189
Posted: Sun, 2005-10-16 20:54

Sorry, my comment was just that this thread has a number of issues in it, which can make it difficult to keep track of, whereas the other link I mentioned was specific to this problem.

I rechecked my test site and I found that the search works correctly with Drupal clean_urls on, but incorrectly with clean_urls off. Can you please confirm if this is the case on your site (if you are able to). In the meantime, now that I know how to cause the problem I'll try to come up with a fix.

 
kiz_0987

Joined: 2005-02-27
Posts: 189
Posted: Sun, 2005-10-16 21:47

I've uploaded a patch for the search problem at http://drupal.org/node/34301. Let me know if it works or not for you.

 
graffixjones

Joined: 2005-10-13
Posts: 8
Posted: Sun, 2005-10-16 22:28

kiz_0987,
I see your point, however I also think that 'any' issues related to Drupal->Gallery2 integration should be in the same thread, being that when people search the forum, they can find all the potential issues in one place, rather than looking in several separate threads (or 'nodes' I should say. :) ). I also apologize if I sounded a bit snippy.

I applied your patch manually (since I'm using lvthunder's module attached in his above post), and it works like a charm. Thank you very much... you're now my hero. :)

graffix.