G2Image - nothing happens after clicking "Insert"

ep01

Joined: 2007-10-14
Posts: 10
Posted: Sun, 2007-10-14 18:59

Hello!

I have successfully installed and validated the latest WPG2. Tags and sidebar are working well. However, G2Image shows up, I can check the images I want, but when clicking on "Insert" nothing happens.

I have Wordpress 2.3 and Gallery 2.2, I tried with both visual and code editor in WP. I tried on IE6/Win32, Firefox/Win32, Firefox/Mac, Safari/Mac, and I did several reloads/refreshes and deleted private data to make sure there is no cache problem.

Interestingly enough, IE says there was a JavaScript error at line 158, char 3, code 0, eror text: "window.opener.document.forms[...].elements is null or not an object". Unfortunately it did not name the file the problem was occuring.

The online demo of G2Image is working, so I also don't believe that there is a browser issue, rather a script issue in my installation. However, I have no other scripts installed, not even other plugins, and well, in the WP admin interface there could not even be an interference with my theme.

Unfortunately I have no idea where to look... Maybe somebody can help! Many thanks in advance! The WPG2 plugin is for sure really cool stuff and I'd love to use it including G2Image...

Best regards,

Emanuel

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-10-14 19:49

That error means that g2image thinks that it was not called from TinyMCE (the rich-text editor), when it was. Try changing to "Code" view and see if it does the same thing when you hit the WPG2 quicktag.

Also, there are two places you need to do a browser refresh. One is on the G2Image window itself. The other is on the Write Post page. The refresh on the Write Post page is the one that actually reloads the core TinyMCE.

Finally, are you using any other plugins that would affect TinyMCE, like the Advanced TinyMCE plugin or something like that?

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

 
ep01

Joined: 2007-10-14
Posts: 10
Posted: Sun, 2007-10-14 21:14

Dear Kirk,

thanks for your reply. Yes, I tried multiple reloads, both inside the G2Image window, and on the Write Post page.

To be absolutely sure I reinstalled Wordpress and copied wp-content/ and wp-config.php from the old installation. Still the same. The only plugin that is active is the WeatherIcon plugin. I remember that (two years ago) I once tried the ChenPress plugin which was an alternative editor. But these plugin files are long gone, multiple updates have come, and now I have reinstalled Wordpress - could be that traces of that are still somewere in the system?

However, I CAN insert one (and only one) image with G2Image - a link to the current album. Very strange. And only once per session. This is again consistent with multiple browsers.

I made a short screencast displaying the strange behaviour - maybe this helps you (made in Safari, but again, in Firefox it looks identical):
http://screencast.com/t/aFf0aovlBa

Best regards,

Emanuel

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-10-14 22:30

Emanuel,

Jing is awesome! That really helps to see exactly what you're seeing.

But I'm still stumped as to why it's failing. I really don't understand why the album would work, but not the tags. I'll have to look at the code to see what the difference is.

Oh, one thought: when you validate WPG2, are you getting a warning about having an old version of the G2 ImageBlock module?

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

 
ep01

Joined: 2007-10-14
Posts: 10
Posted: Sun, 2007-10-14 23:09

Hi again!

No, I don't get any warnings when validating. My gallery is installed in gallery/ not in gallery2/ - could this be a problem?

When I change the insertHtml() function in functions.js I can make it work in WP's TinyMCE through the brutal way - by removing the if and forcing it to do the tinyMCE command:

Instead of
if(window.tinyMCE)
window.opener.tinyMCE.execCommand("mceInsertContent",true,html); [...]

I just write:
window.opener.tinyMCE.execCommand("mceInsertContent",true,html);

So for some reason window.tinyMCE is not defined for me. But this opens up more questions:
a) why is window.tinyMCE not defined here?
b) why is the fallback plain html insert (the third clause of the if statement) not working...

To be absolutely sure I grepped through my wordpress files, and the string FCK does never appear (case insensitive search). So there is for sure no FCKEditor somewhere.

Strange... Really strange. I mean, constructs like win.tinyMCE are used by Wordpress' own upload function and don't have any problems here.

Best regards,

Emanuel

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-15 00:30

/gallery/ or /gallery2/ won't matter.

From your video, you're not using TinyMCE, the rich-text editor. So, it makes more sense. But I'm not sure why the form variable isn't filled in. I would say it's a Safari thing, but you said it does the same thing in Firefox, too. Did you disable the rich-text editor in the User profile window? If not, that could be part of the problem. But even in code view, if the WPG2 tab is there, it sets the form variable and it should work.

I'm thinking I must have made a mistake in the code view for the WPG2 tags when I fixed the ImageBlock version issue for G2Image 3.0.2. My dev box's battery is dead, and I left the power brick at work. So, I won't be able to do any troubleshooting until tomorrow. (I could troubleshoot using a text editor, but it's so much easier and faster with the tool suite I've put together on my dev box. And I'm tired enough now that I'd miss something anyway...)

More to follow tomorrow.

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

 
ep01

Joined: 2007-10-14
Posts: 10
Posted: Mon, 2007-10-15 06:55

Hi!

I made another screencast to illustrate the problem with TinyMCE and Firefox (I even created a new wordpress user for that):
http://screencast.com/t/aqaIjoDd

I need to stress the fact that it works neither with TinyMCE nor with the simple WP editor. Yesterday night I did make it work with TinyMCE due to the "brutal" script modification, but of course that broke the simple editor.

I love Jing :-) Here is another screencast showing my WP options pages:
http://screencast.com/t/pCUtgBBD

Thanks very much - I will try to get more information. My server is an up-to-date system of Ubuntu 6.06.1 with its latest Apache 2.0.55 packages and php 5.1.2-1ubuntu3.9. Regarding clients I mostly work on OSX now, but I also tested with IE6 on Windows 2003 Server (our terminal server).

Best regards,

Emanuel

 
capt_kirk

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

Thanks. I understand the problem better now (especially after reading your messages in detail, instead of skimming them in a hurry over the weekend... :) )

Right now, I'm stumped. If the demo works for you, then I agree that it's not a browser issue. I just checked the demo as a reminder to myself, and it's running WP 2.3, so I don't think anything in 2.3 broke it.

Would it be possible to make a temporary WP admin account for me so that I can look at the page source on the admin page and do some Firebug troubleshooting? If so, please PM me the username and password.

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

 
ep01

Joined: 2007-10-14
Posts: 10
Posted: Mon, 2007-10-15 14:08

Dear Kirk!

Thanks very much for your help - and of course for the good work. I did now what you wanted to do - debug the page source. I then found out what the problem is. PHPMyVisites is loaded and this breaks G2Image.

I then removed PHPMyVisites and now the site is working. I never thought that PHPMyVisites could break ANYTHING, yesterday I even forgot that I was using that stuff.

Now of course I become interested in WHY it breaks G2Image ... But to find out, I need to install a newer version of PHPMyVisites - now playing with my older version may not lead to anything of use... If I find something useful I will of course inform you...

Thanks very much again for your help!

Best regards,

Emanuel

 
capt_kirk

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

Great! Glad that it's working. I'm not familiar with PHPMyVisites. I'll take a look at it. If you figure out a root cause, please let me know.

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