Hi,

I have a problem with my Gallery2 integration in Drupal. I was able to setup you everything without any hickups. Unfortunately I am unable to view pictures. When I look at my embedded gallery in drupal, I am able to navigate to different albums (by clicking on texts rather than thumbnails) but none of the pictures get downloaded. My standalone gallery site works well.

Gallery2 installed in /wwwroot/gallery2 (gallery.mydomain.com)
Drupal installed in /wwwroot/drupal (mydomain.com)

Gallery - 2.2.2
Drupal - 5.1
Gallery Module - 5.x-2.x-dev

Running on a 1and1 shared host with PHP5.

I am not a programmer nor an administrator and do know what other information you might need to understand this problem. If you can let me know what to do, I would be more than happy to provide more information about my installation.

CommentFileSizeAuthor
#4 gallery_outside.patch4.69 KBprofix898

Comments

profix898’s picture

Priority: Normal » Critical

Multiple users reported issues when G2 is installed outside the Drupal 5 folder, e.g.

    Path to Gallery2: /htdocs/gallery2
    Path to Drupal 5: /htdocs/drupal5

I would consider the above configuration to be broken with the 5.x-2.x development version of the gallery module. Its quite easy to reproduce though. I will start to work on this and related issues as soon as possible.

@aravind_s_in: I will use your issue to post progress and to collect feedback on related issues. Stay tuned.

profix898’s picture

Title: Unable to view pictures » Issues with G2 installed outside Drupal folder
mike15’s picture

I am also effected by this issue so if you need any testing, please let me know

Thanks!

profix898’s picture

Status: Active » Needs review
StatusFileSize
new4.69 KB

Here is a very first to patch to solve the js/css script issues. I'm not sure it will get in as it is now. Maybe it would be better to remove gallery_set_js/css altogether and revert to always use drupal_set_html_head(). However we would loose the ability to cascade the G2 files with the Drupal files. All G2 stuff would be added at the very beginning of the resulting page, even before jquery.js, etc. But as drupal_add_js/css does still not support external files, there is no way around drupal_set_html_head() at least for setups where G2 is installed outside the Drupal root directory. I will ask kiz_0987 for his opinion ...

Please note that you will need to reconfigure (Reset&Restart) your configuration (admin/settings/gallery/install) for this patch to work correctly.

FYI: One major reason I introduced gallery_set_js/css was for issues with thickbox/lightbox integration with Drupal/G2. This kind of integration/interaction requires jquery.js and certain Drupal styles to be added first. The current gallery_set_css() function can also be easily expanded to support drupal_alter() or any hook-based api, e.g.

<?php
foreach ($css as $include) {
  if (!in_array(($md5 = md5($include)), array_keys($css_memory))) {
    $css_memory[$md5] = $include;
  }
}
drupal_alter('gallery_css', $css_memory);
foreach ($css_memory as $include) {
  //... include the styles here ...
}
?>

This would greatly simplify tighter integration of G2 as it would allow us to alter the G2 css, include only required pieces or even store the required css in context with nodes (for development of gallery_content.module). However this will not work for G2 outside Drupal root as long as drupal_add_js/css does not support external files.

profix898’s picture

Status: Needs review » Needs work

We (kiz_0987 and I) decided to drop cascading css/js support for G2 installations outside Drupal root. We will advice new users to place G2 inside Drupal root to obtain all feature of gallery module. However except for certain features the gallery module will continue to allow separate G2 installations.

Users will have to decide for
1. installing G2 inside Drupal root and getting access to some advanced features OR
2. keeping G2 outside Drupal root and therefore loose cascading js/css support (and some other future features)

I will revise the patch above and verify it working with different configurations. We still hope for Drupal core to accept external css/js in the future (Drupal7?), but for D5.x/D6.x we have to live with that limitation. The only way to workaround this problem is to create symbolic links from external G2 to the Drupal root directory, which allows direct filesystem access to the 'external' files. This possibility requires additional logic for the above patch to detect such configuration correctly.

mike15’s picture

@profix898,

Based on your recommendation, I have moved my gallery root directory inside the drupal root folder to hopefully accommodate issues that we have been seeing with URI settings.

So basically, I have moved the wwwroot/gallery to wwwroot/drupal/gallery and simply created a Redirect from the original URL to handle the old references.

To my understanding, the G2 is still it's own entity but is now reachable via www.website.com/gallery instead of gallery.website.com.

The trouble is primarily with URI reference since no matter what I put, it expects the G2 to be under root instead of URI prefix "/gallery/"

Is this still considered a bug or by design?

Thanks.

profix898’s picture

@mike15: "I have moved the wwwroot/gallery to wwwroot/drupal/gallery"

This will not work. You should move it to e.g. "wwwroot/drupal/gallery2" From the installation instructions:
Warning - Do not name your G2 directory "gallery", call it something else (eg "gallery2"). Calling it "gallery" will cause a conflict with the Drupal gallery.module as Drupal assumes that http://www.example.com/gallery refers to the Drupal module.

mike15’s picture

@profix898,

Sorry for the confusion, the purpose was to indicate the directory structure. The actual name is wwwroot/drupal/photo2 which I believe should be ok.

profix898’s picture

Status: Needs work » Fixed

I have just committed a patch to check the G2 location in the install wizard. It adds a warning message, if G2 is installed outside the Drupal root directory advising the users to move. See http://drupal.org/node/157903#comment-275923 for details. We are working on more detailed install/update instructions. Help on the docs would be appreciated (see http://codex.gallery2.org/Integration:Drupal).

There is no update path available atm: http://drupal.org/node/171577

Anonymous’s picture

Status: Fixed » Closed (fixed)