Ruby Forum Radiant CMS > Radiant 0.6.6 - WYMeditor not working

Posted by David Piehler (davidpiehler)
on 22.04.2008 00:03
Is anyone else having trouble with Radiant 0.6.6 and WYMeditor? I'm
getting JavaScript errors on page load that are preventing the WYMeditor
Filter from loading.

My setup...

* running in development mode on 0.6.6 gem
* tested in both existing and new app (new app setup is as follows)
* environment.rb setup is correct:
  config.extensions = [ :shards, :wym_editor_filter, :all ]
* :all = the default Archive, Markdown, Textile
* Shards is fresh from the SVN repository tag 0.6.6
* WYMeditor is fresh from
http://www.gorilla-webdesign.be/artikel/48-WYM+on+Radiant

Firebug says...

prototype.js (line 3484)
element has no properties
var method = element.tagName.toLowerCase();

Anybody else seeing this?
- Dave
Posted by Mark Gallop (Guest)
on 22.04.2008 05:18
(Received via mailing list)
Hi David,

David Piehler wrote:
> Firebug says...
>
> prototype.js (line 3484)
> element has no properties
> var method = element.tagName.toLowerCase();
>
> Anybody else seeing this?
> - Dave
>   

I am getting the same. See the comments at the bottom of the maintainers
post - http://gorilla-webdesign.be/artikel/48-WYM+on+Radiant.

Cheers,
Mark
Posted by David Piehler (davidpiehler)
on 22.04.2008 18:37
Mark Gallop wrote:
> I am getting the same. See the comments at the bottom of the maintainers
> post - http://gorilla-webdesign.be/artikel/48-WYM+on+Radiant.

It looks like the issue is 0.6.6 is outputting filter select tags with 
id="part_0_filter_id" while WYMeditor is looking for the old style of 
id="part[0][filter_id]". I've fixed this for Pages and am working on 
Snippets. I'll paste the necessary code changes as a pastie when I'm 
done.

- David
Posted by David Piehler (davidpiehler)
on 22.04.2008 19:14
David Piehler wrote:
> It looks like the issue is 0.6.6 is outputting filter select tags with 
> id="part_0_filter_id" while WYMeditor is looking for the old style of 
> id="part[0][filter_id]". I've fixed this for Pages and am working on 
> Snippets. I'll paste the necessary code changes as a pastie when I'm 
> done.

It looks like fixing Snippets compatibility with WYMeditor is a bigger 
issue, so I need to leave that alone for now, sorry.

Here are the code fixes to get WYMeditor back up and editing Pages:

http://pastie.caboo.se/184897
http://pastie.caboo.se/184899

- David

Posted by Mark Gallop (Guest)
on 23.04.2008 05:22
(Received via mailing list)
Hi David,

David Piehler wrote:
> http://pastie.caboo.se/184897
> http://pastie.caboo.se/184899
>
> - David
>   

Thanks for the updates. They don't seem to be working yet but I will
need to double check my changes.

Also, you are still using .rhtml. I thought that as Radiant 0.6.6 used
Rails 2 that you would need to use .html.erb.

Cheers,
Mark
Posted by David Piehler (davidpiehler)
on 23.04.2008 13:24
Mark Gallop wrote:
> Thanks for the updates. They don't seem to be working yet but I will
> need to double check my changes.
> 
> Also, you are still using .rhtml. I thought that as Radiant 0.6.6 used
> Rails 2 that you would need to use .html.erb.

I grabbed the newest version of WYMeditor and the 0.6.6 tag SVN 
repository version of Shards. Maybe you are using an older version of 
one or the other? Also, the second pastie can either go in the extension 
before the rake task, or in the app's public directory after the rake 
task.

I believe Rails 2 allows for .rhtml for backwards-compatibility, but 
.html.erb is the preferred method going forward.

- David

Posted by David Piehler (davidpiehler)
on 08.05.2008 20:50
David Piehler wrote:
> It looks like fixing Snippets compatibility with WYMeditor is a bigger 
> issue, so I need to leave that alone for now, sorry.

Tim Blair has handled fixing Snippets in WYMeditor. Check out the 
following for his patch:

http://gorilla-webdesign.be/artikel/48-WYM+on+Radiant
http://pastie.caboo.se/186091

- Dave
Posted by Benny Degezelle (jomz)
on 10.05.2008 18:51
Hi,

I updated the extension with David and Tim's patches. The extension is 
now also hosted on github; http://github.com/jomz/wymeditor-for-radiant

do let me know if you encounter any problems with it.

Regards,

Benny