qTranslate Widget Validation Fixer
This is a small plugin which fixes a validation error I was having with otherwise brilliant qTranslate plugin. Basically there were duplicate ID’s on the page, and I kept getting this error:
ID "qtranslate-3" already defined
For more, refer to this thread.
To date this doesn’t seem to have been fixed (I suspect not everyone experiences this issue), so I wrote a small plugin which manually re-writes on the qTranslate plugin files to get around the error.
Instructions:
- Copy into your wp-content/plugins directory.
- Activate it (with qTranslate already activated)
- You can de-activate immediately afterwards.
- Repeat steps 2 & 3 each time you update qTranslate
Download v1.1: qTrans Fixer Plugin
Great! though.. the download link does not seem to work ?
Comment by arjen — 10 September, 2009 @ 10:32 pm
Whoops, forgot to zip it. Try now?
Comment by John — 15 September, 2009 @ 11:46 am
Thanks for writing a fix for this issue!
However, I can’t get it to work on my site. When trying to activate the plugin, I get this error:
Fatal error: Cannot redeclare qtwvf_fix() (previously declared in [...]/wordpress/wp-content/plugins/qtrans-fixer-plugin.php:15) in [...]/wordpress/wp-content/plugins/qtrans-fixer-plugin.php on line 13
I’m using Wordpress 2.9.4 and qTranslate 2.4.3 which I just re-installed. Do you have any idea what’s going wrong here?
Comment by Jul — 3 October, 2009 @ 8:30 pm
… I meant Wordpress 2.8.4., of course.
Comment by Jul — 3 October, 2009 @ 8:32 pm
Ok it seems this an issue sometimes.. have updated to version 1.1, see if that fixes it?
qtrans-fixer-plugin-1.1.zip
Comment by John — 3 October, 2009 @ 8:55 pm
Wow, that was fast!
Unfortunately, now I get a different error:
Parse error: syntax error, unexpected T_SL in /wordpress/wp-content/plugins/qtrans-fixer-plugin.php on line 12
Comment by Jul — 3 October, 2009 @ 9:14 pm
Haha you’re just lucky I was at the computer
Hmm what version of PHP are you using? I’m guessing it’s earlier than 5.3.0 ?
Comment by John — 3 October, 2009 @ 9:22 pm
Lucky me.
Yes — my PHP version is 5.2.9. I’ve already asked my hoster when they’re going to upgrade.
Comment by Jul — 3 October, 2009 @ 9:39 pm
If you’re still having a problem with is, best thing is just to do it manually:
open
qtranslate_widget.php, and find the instruction below, around line 38:qtrans_generateLanguageSelectCode($type, $this->id);Simply append something to the end of the second parameter, like so:
qtrans_generateLanguageSelectCode($type, $this->id.'_123');That’s it!
Comment by John — 8 October, 2009 @ 10:40 pm