I have installed Drupal 6.4, Gallery2.3-RC1, the Drupal Gallery module and Gallery add-on modules, and G2Image. I can now work Gallery2 through Drupal. But the Gallery Field and Gallery Services modules are grayed out and I cannot activate them. In the G2Image setup I am told that the G2Image Block module is activated but G2Image is missing. I cannot figure out how the Drupal Gallery modules and G2Image are supposed to be configured.

I tried placing the G2Image directory immediately below Drupal in the all/sites/modules directory and in the all/sites/modules/Gallery directory. That does not change Drupal's failure to recognize it. I have tried placing the Drupal Gallery and Gallery add-on modules in the all/sites/modules directory and the all/sites/modules/gallery directory. I have not been able to activate them in either location.

I have Clean URLs and URL rewrite working in Drupal and Gallery2, so I do not think that is causing a problem.

Where am I supposed to put this stuff and how do I make Drupal see them?

Thanks.

Comments

LarsBV’s picture

had same problem as you today, but I got an idea when I read some other post comment about plugins and by trial found that:

g2image needs to be put into drupal-6.4\sites\all\modules\tinymce\tinymce\jscripts\tiny_mce\plugins

and I think the following lines are needed in drupal-6.4\sites\all\modules\tinymce\plugin_reg.php
per the g2image wiki for drupal 4.7

$plugins['g2image'] = array();
$plugins['g2image']['theme_advanced_buttons2'] = array('g2image');

then you can go to site configuration->gallery->g2image

I hope this help.

Regards
Lars

rsbecker’s picture

That helped a lot. I had tried to use G2Image as a standalone plugin, but have installed TinyMCE.

But I still cannot enable Gallery Services and Gallery Field modules. The check boxes are grayed out.

kittell’s picture

I had trouble integrating G2 Image with Drupal 6.6 today, but I just figured it out.

Initial setup:

Leaving out the many things I did wrong, here is how the setup worked:

1) Upload g2image to /MYDRUPALFOLDER/sites/all/modules/wysiwyg/tinymce/

2) Edit /MYDRUPALFOLDER/sites/all/modules/wysiwyg/editors/tinymce.inc. This is where the TinyMCE plugin documentation says to 'add the plugin name in the "plugins" comma separated line.'

Within the wysiwyg_tinymce_plugins function, I placed the following code in the $plugins array.

    'g2image' => array(
      'path' => $editor['library path'] .'/plugins/g2image',
      'buttons' => array('g2image' => t('G2 Image')),
      'url' => 'http://g2image.steffensenfamily.com/',
      'internal' => TRUE,
      'load' => TRUE,
    ),

3) After (2), the G2Image button didn't appear in the TinyMCE menu yet, so I added it manually. In the WYSIWYG module settings (http://MYDRUPALSITE/admin/settings/wysiwyg/profile), I edited the settings in the Full HTML profile. In the Buttons and plugins menu, check the box for G2Image.

3b) After this process I had access to G2Image in my TinyMCE menu. However, by selecting G2Image in the WYSIWYG module settings, only the G2Image button was available in TinyMCE; apparently when you select your own settings, the TinyMCE menu replaces the default buttons with only the buttons you have selected. So I went back to the Buttons and plugins menu and selected all of the other settings I wanted: bold, italics, links, etc.

I hope this helps. I couldn't find any advice via Google about integrating G2Image with Drupal 6.x. I have all of two weeks experience with Drupal, so let me know if I've kludged anything or missed some obvious HOWTO guide for G2Image somewhere...

mike15’s picture

This was very useful for me to figure out. I was able to follow the step as outlined and get G2Image to work right away with Drupal 6.10

Again, thanks for the efforts.

Mike

attilahooper’s picture

This worked for me. Thx for that.

1) Upload g2image to /MYDRUPALFOLDER/sites/all/modules/wysiwyg/tinymce/

2) Edit /MYDRUPALFOLDER/sites/all/modules/wysiwyg/editors/tinymce.inc. This is where the TinyMCE plugin documentation says to 'add the plugin name in the "plugins" comma separated line.'

Within the wysiwyg_tinymce_plugins function, I placed the following code in the $plugins array.
'g2image' => array(
'path' => $editor['library path'] .'/plugins/g2image',
'buttons' => array('g2image' => t('G2 Image')),
'url' => 'http://g2image.steffensenfamily.com/',
'internal' => TRUE,
'load' => TRUE,
),

3) After (2), the G2Image button didn't appear in the TinyMCE menu yet, so I added it manually. In the WYSIWYG module settings (http://MYDRUPALSITE/admin/settings/wysiwyg/profile), I edited the settings in the Full HTML profile. In the Buttons and plugins menu, check the box for G2Image.

3b) After this process I had access to G2Image in my TinyMCE menu. However, by selecting G2Image in the WYSIWYG module settings, only the G2Image button was available in TinyMCE; apparently when you select your own settings, the TinyMCE menu replaces the default buttons with only the buttons you have selected. So I went back to the Buttons and plugins menu and selected all of the other settings I wanted: bold, italics, links, etc.

milplus’s picture

I found great your instruction. I've done 99% of the integration og G2 into drupal 6.22 .
however still two problem to sort

1) when I click on G2 BUTTON to pick Picture from Gallery Album I get

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions.
For WordPress users, Validate WPG2 in the Options Admin panel.
For other platforms, please verify your Gallery2 path in config.php.

Can you advise what I have to do. I tried to open config.php but it looks ok.

2) G2 and Ubercart store: I need to have images of the Products picked pout by G2 Albums. Is there any way you know to do it?

hope you can help me with both points. sorry for the hassle but it's very frustrting for me and it took a lot of time longer than expected with integration.

thanks

milplus’s picture

dear kittel in reference to your post

http://drupal.org/node/300305#comment-1143878

I'm in trouble with the integration of g2image chooser

particularly I've followed instruction installing gallery2 and embedding g2 image chooser. however I had to upload several libraries and modules

particularly as below
1. .../sites/all/modules/wysiwyg/plugins/g2image ---> config1.php
2. .../sites/all/modules/gallery/gallery_g2image/g2image ---> config2.php
3. .../sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image --->
config3.php
4. ../gallery2 ---> config4.php

where I see config2.php = config3.php looks automatically updated and config1.php different by config4.php

config1.php is different and I guess the WRONG setup of this file might cause that when I CLICK on g2 button Icon I have :

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions.
For WordPress users, Validate WPG2 in the Options Admin panel.
For other platforms, please verify your Gallery2 path in config.php.

MY QUESTION IS : which configX.php? I have four of them.

However looking at the error page on g2 click I see following path

http://mydomain/drupal/sites/all/libraries/tinymce/jscripts/tiny_mce/plu...

so I do not know which one has to be updated with the reccomendation at the following link

http://g2image.steffensenfamily.com/index.php?title=Embedded_Configuration

if you can advise
thanks

milplus’s picture

guys thanks for detailed instruction.

I followed the above. however my G2 image chooser button does not appear as Yet

I have installed both modules WYSIWYG and CK editor becuase it says the old TinyMCE no longer exist being replaced by the two above.

Gallery2 has been embedded ok .
However I need to add the button to add Photos of the album into the pages/nodes in drupal or ubercart products.

tiny MCE 3.4.7 has been installed correctly into library folder.
see below also :
G2Image requires the Gallery2 Image Block plugin (activated) and the G2Image application (activated) to be installed.

So please if anyone can propose something where I might be wrong.

thanks

milplus’s picture

in reference to your post

http://drupal.org/node/300305#comment-1143878

I'm in trouble with the integration of g2image chooser

particularly I've followed instruction installing gallery2 and embedding g2 image chooser. however I had to upload several libraries and modules

particularly as below
1. .../sites/all/modules/wysiwyg/plugins/g2image ---> config1.php
2. .../sites/all/modules/gallery/gallery_g2image/g2image ---> config2.php
3. .../sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image --->
config3.php
4. ../gallery2 ---> config4.php

where I see config2.php = config3.php looks automatically updated and config1.php different by config4.php

config1.php is different and I guess the WRONG setup of this file might cause that when I CLICK on g2 button Icon I have :

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions.
For WordPress users, Validate WPG2 in the Options Admin panel.
For other platforms, please verify your Gallery2 path in config.php.

MY QUESTION IS : which configX.php? I have four of them.

However looking at the error page on g2 click I see following path

http://mydomain/drupal/sites/all/libraries/tinymce/jscripts/tiny_mce/plu...

so I do not know which one has to be updated with the reccomendation at the following link

http://g2image.steffensenfamily.com/index.php?title=Embedded_Configuration

if you can advise
thanks

andyscotuk’s picture

I had the same problem. The location of the tinmce plugins has changed and I had to put g2image here :

/www/sites/all/libraries/tinymce/jscripts/tiny_mce/plugins

Everything then worked great as detailed above.

I still get the "G2image application is missing" error message in the gallery module config page but everrything appears to work. Should I worry about this?

davedickens’s picture

The G2Image part of Gallery is actually it's own module.

You want to actually put the g2image plugin folder (the one you placed in the sites/all/libraries/tiny_mce/plugins into the gallery_g2image folder located INSIDE the Gallery Module folder.

So you should have a directory like www/sites/all/modules/gallery/gallery_g2image/g2image

This will open up a new set of configuration options in your gallery administration page at admin/settings/gallery/g2image
BUT you will still get an error. But if you choose to use g2Image with Tinymce and save your options....you will still get the error "G2Image does not seem to be installed for TinyMCE mode in the required directory (/sites/all/modules/wysiwyg/tinymce/jscripts/tiny_mce/plugins/g2image), or the directory is not writable. Please see the INSTALL.txt for instructions."

To fix this, you have to tell the g2image part of the Gallery module not to look at the OLD location for editor plugins for WYSIWYG...but to look in sites/all/libraries/tinymce

Open up the gallery_g2image_settings.inc file (located at sites/all/modules/gallery/gallery_g2image ) and on line 207 to 210 make the following TWO changes:

1. THE FIRST part is that it's checking for the path to the plugins folder based on the the relative location of the wysiwyg module directory with the "drupal_get_path" function.

} else if (module_exists('wysiwyg')) {
  $path = drupal_get_path('module', 'wysiwyg');
  }
 $path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';

So just get rid of that all together and change it to this:

 } else if (module_exists('wysiwyg')); 
      $path .= 'sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image';

...and yes...leave off the beginning slash.

2. THE SECOND part is down around line 327 where it's calling the same function.
Just comment out the line looking for the wysiwyg location.
$path = drupal_get_path('module', 'wysiwyg'); like so // $path = drupal_get_path('module', 'wysiwyg');

and change the next line from this:
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';

To the correct path

$path .= 'sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image';

This seems to be working for me....what really needs to happen is to add in a wee bit more code to scan for BOTH directories for the g2image folder....but I didn't have time for all that.

jrtorrent’s picture

davedickens, First and foremost thank you so much! your posting above ended an almost 24 hour frustration from Hell.

24 hours, 3 patches later, gazillions of fruitless searches on Drupal & Google, and countless module installs, ... etc. I have a TinyMCE, wysiwyg and g2image implementation working ... or not? I cannot find what I could call documentation on TinyMCE to help me navigate the editor. Right now when I want to edit or create a new item, the editor window, normally a white box, shows up as a somewhat dark green background with light green lines, a "Path:p" on the bottom on a white line, all the buttons I want to enable on the top and it allows rich-text only. When I disable the rich-text all buttons disappear and the editor window is white.

Question #1: Is there a decent How to use TinyMCE around? if so ignore the following questions (2 & 3), else

Question #2: Where are the setup/config variables or lines of code or init (config) files to make the changes on background and/or setup preferences?

Question #3: Is there a way to change the default option on G2image "how to Insert Image?" drop down window?

Question #4: I need to ask this one because I know I'm missing something ... important.

Why are you folks so intense about TinyMCE/wysiwyg/G2image when there are so many wysiwyg editors floating around?

I will appreciate anyone willing to enlighten me and the rest of the "uninitiated" .

Again, thanks for your posting. It is invaluable for people even if they have the knowledge since they can be working in solving other problems that benefit everyone. Actually this should to be on the main page of G2image AND wysiwyg. I will save tons of time and frustration.

MjrNuT’s picture

I really appreciate the time that you folks put to describing the configuration here. Big kudos to atillahooper and davedickens. Thank you so much for your layout.

I had to piece it together as I already had the majority of tinymce installed.

What was lacking for me was:

1. all of davedickens input.

2. and just no. 2 portion of atillahooper.

An important point here is what andyscotuk points out for the libraries location for tinymce. I have that configured in that method.

Cheers!

attilahooper’s picture

But you are right, it is a combo of the two contributors. Kittels editing of the plugin array and dave's stuff.

benjifisher’s picture

I followed all of the instructions given by kittel (and quoted by atillahooper) and it seems to work fine. I do not mind too much that the Gallery/G2Image module cannot find my G2Image installation. But then I made a symbolic link from sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image to sites/all/modules/gallery/gallery_g2image/g2image and looked at the G2Image admin screen, and I wonder if that would have been a simpler route.
(Update: The G2Image module will overwrite g2image/config.php, so if you use it in a multi-site setup, use it before making the modifications below.)

I have several sites running from a single installation of Drupal/Gallery2, so the G2 directory for <sitename> is sites/<sitename>/gallery2. To get this to work, I edited g2image/config.php as follows. Near the top of the file, I added the lines

/* BF:  Set up for multi-site. */
$protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'];  // Includes port number.
$server = $_SERVER['SERVER_NAME'];
$g2ic_gallery2_path = "sites/$server/gallery2/";
## $g2ic_gallery2_path = "gallery2/";

(The commented-out line at the end shows exactly where I put this. I include the PHP tags here to get highlighting, but I did not add them to the file.)
Near the bottom of the file, in the EMBEDDED MODE OPERATIONS section, I made the following changes:

$g2ic_embedded_mode = TRUE;
$g2ic_gallery2_uri = "$protocol://$host/sites/$server/gallery2/main.php";
$g2ic_embed_uri = "$protocol://$host/gallery";
$g2ic_drupal_g2_filter = TRUE;

Maybe not all of this was necessary, but it seems to work. YMMV.

koppie’s picture

It's easier to use the stand-alone G2Image button. Not as graceful, but I hate hacking code. This issue is being tracked here: http://drupal.org/node/350100#comment-3270452 . The issue is older than my kid and shows no sign of getting fixed. I'm hoping that the devs will step back in and write the necessary changes so this works again, hack-free. In the mean time I'm posting here so I can follow the progress in this thread.

milplus’s picture

dave I found very good the post and very useful. I got it working but:

my question is:

I need to use the Gallery upload pictures into my Ubercart store with drupal 6.x .

is there a way to do this ?

can you adivse.

I had g2image and Gallery2 perfectly working and embedded , however apparently cannot go through the last real step to get shown the g2 images into ubercart store product node.

thanks

milplus’s picture

dave I found very good the post and very useful. I got it working but:

my question is:

I need to use the Gallery upload pictures into my Ubercart store with drupal 6.x .

is there a way to do this ?

can you adivse.

I had g2image and Gallery2 perfectly working and embedded , however apparently cannot go through the last real step to get shown the g2 images into ubercart store product node.

thanks

milplus’s picture

GUYS I'M SO FRUSTRATED
cannot get G2 image chooser which apparently it's all perfectly integrated into drupal 6.22 working right way.

so 500 threads closed because solved - followed them along but no way.

permissions looks ok

all path to Tinymce and g2image plugin checked ten tims looks good.

any time click on G2 image button I get the below message:

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions
For WordPress users, Validate WPG2 in the Options Admin panel.
For other platforms, please verify your Gallery2 path in config.php.

but this is diverting my investigation nothing on config.php to change.

probably on the below path
/sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/g2image/g2image.php?g2ic_tinymce=1&4

please someone CAN HELP ME?
I'm pulling my hairs and getting mad

thanks

davedickens’s picture

I don't really know the first thing about configuring Ubercart, but I do know that it has it's own Picture/Image functionality, so what you are talking about is adding or changing their default method over to G2image.

Don't put the cart before the horse though. Make sure you have G2image working in Drupal by itself first...then try to port it to Ubercart.

Your error message is quite clearly saying that your not configured properly.

It has been 3 years since I visited this issue.

I would suggest that you visit Ubercart.org and see if anyone there has any experience with G2 in Ubercart.

milplus’s picture

Forget ucart for now

Please advise on the g2image config please

Thanks

BennieB-2’s picture

I'm working with Drupal 6.14, Gallery 2.3 and G2Image 3.0.3. The installation was succesfull but when i use de g2image button in tinymce only the first album in gallery can be seen. The subalbums don't appear in the tree. Does anyone has a hint?

KhaledBlah’s picture

Have you checked out the permissions on your albums? I recall them being an issue when I started with the G2 button. I am not sure which ones but I think the G2 button needs certain permissions on the albums to work.