Joomla: Undefined index: tinymce in [path]/g2image/g2image.php on line 756, 759

hansmast

Joined: 2007-09-26
Posts: 4
Posted: Wed, 2007-09-26 20:01

Joomla! 1.0.13 (latest stable)
Gallery 2.2.3 Typical (latest stable)
Gallery2 Bridge 2.0.14 (beta)
G2Image 3.0 (latest stable)

Followed instructions here: Embedded Configuration (For G2Image version 2.0 (for Gallery2 2.1.x) or version 2.2 (for Gallery 2.2.x)) and Editor-specific configuration (Built-in TinyMCE). Changed following lines in config.php:

Quote:
$g2ic_embedded_mode = TRUE;
$g2ic_gallery2_uri = 'http://209.40.97.62/goodlifeministries/gallery2/main.php';
$g2ic_embed_uri = 'http://209.40.97.62/goodlifeministries/index.php?option=com_gallery2&Itemid=32';

(Site is live, so you can check URIs.)

Getting following error when clicking on G2Image/tinyMCE button:

Quote:
Notice: Undefined index: tinymce in /var/www/html/goodlifeministries/mambots/editors/tinymce/jscripts/tiny_mce/plugins/g2image/g2image.php on line 756

Notice: Undefined index: tinymce in /var/www/html/goodlifeministries/mambots/editors/tinymce/jscripts/tiny_mce/plugins/g2image/g2image.php on line 759

Tried changing:

Quote:
756: if($g2ic_options['tinymce'] && $g2ic_options['wpg2_valid']) {
757: $html .= " <script language='javascript' type='text/javascript' src='../../../../wp-includes/js/tinymce/tiny_mce_popup.js'></script>\n";
758: }
759: elseif($g2ic_options['tinymce'] && !$g2ic_options['wpg2_valid']) {
760: $html .= " <script language='javascript' type='text/javascript' src='../../tiny_mce_popup.js'></script>\n";
761: }

to:

Quote:
756: //if($g2ic_options['tinymce'] && $g2ic_options['wpg2_valid']) {
757: //$html .= " <script language='javascript' type='text/javascript' src='../../../../wp-includes/js/tinymce/tiny_mce_popup.js'></script>\n";
758: //}
759: //elseif($g2ic_options['tinymce'] && !$g2ic_options['wpg2_valid']) {
760: $html .= " <script language='javascript' type='text/javascript' src='../../tiny_mce_popup.js'></script>\n";
761: //}

because I'm not using WP anyway. It outputted the source as expected and the path to tiny_mce_popup.js was correct. But while it removed the PHP errors, it still threw the G2Image error:

Quote:
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.

 
hansmast

Joined: 2007-09-26
Posts: 4
Posted: Wed, 2007-09-26 20:07

One note: I don't have any of the Joomla modules of Gallery2 Bridge installed--just the component. Surely G2Image isn't dependent on mod_g2bridge_image?

Edit: I installed mod_g2bridge_image and it didn't fix the problem.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-09-26 20:37

Thanks for the feedback. Seeing your post reminded me to update the Joomla instructions for version 3.0.

I have the exact same setup on my Joomla testbed. I just tested it again, and I don't get the same errors.

I fixed several undefined index issues in the beta versions of 3.0. Could you try downloading G2Image again? (I just posted v3.0.1 with some unrelated bug fixes.)

After you install v3.0.1, please make sure to force a reload of the TinyMCE javascript by right-clicking outside of the TinyMCE window on the "Content Item: New" page, and clicking on reload for FF or refresh for IE.

That "Fatal Gallery2 Error" message means that it doesn't like your embedded setup. On some servers, you have to use the $g2ic_use_full_path = TRUE; option because it can't find it's way around using $_SERVER['PHP_SELF']. Could you try that? You'll also have to put the full path in $g2ic_gallery2_path.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
hansmast

Joined: 2007-09-26
Posts: 4
Posted: Thu, 2007-09-27 02:28

Ok, got it working. Thanks for pointing me to $g2ic_gallery2_path. As I'm sure you are well aware, that needs to be relative to the web root. As you can see from the URIs above, the gallery2 folder is not in root. This fixed it:

Quote:
$g2ic_gallery2_path = "goodlifeministries/gallery2/";

I would suggest adding something like this to the wiki install page:

Quote:
If gallery2 is not located in a subfolder in your web root, make sure and change $g2ic_gallery2_path to being the relative path from your web root.

Granted, I should have looked through the whole config file, but also it would have been quite helpful to have that mentioned in the install wiki because not all setups are the same.

Thanks for your help and your work in writing/maintaining/supporting this excellent plugin!

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Fri, 2007-09-28 16:03

Thanks for the feedback. The wiki installation page already said

Quote:
2. If you are NOT using WordPress, check config.php to make sure that $g2ic_gallery2_path is pointing to your Gallery2 directory.

I've updated it to say

Quote:
2. If you are NOT using WordPress, check config.php to make sure that $g2ic_gallery2_path is pointing to your Gallery2 directory. ($g2ic_gallery2_path is relative to the server root, unless $g2ic_use_full_path is set to TRUE, in which case it is the full server path to Gallery2.)

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
hansmast

Joined: 2007-09-26
Posts: 4
Posted: Sat, 2007-09-29 06:59

Oh, ok. I probably am being ignorant, but I was under the impression that I only needed to follow instructions on the Joomla installation page. It does appear to have A to Z installation instructions. You might want to make it one or the other--clearly a supplement to the full instructions with references to the full instructions or a complete set of instructions. I'm not saying that you made a mistake in the way you set it up--on the contrary, careful examination would probably reveal you had all your ducks in a row--however, just so you are aware that at least one user was a bit confused. =)

Thanks again!

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-01 13:42

Good point. I added a note to the tops of the Joomla, Drupal, and Etomite instructions saying that you also need to look at the Installation Page for general installation instructions. Example here.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website