Hello, I am having a strange problem and by debugging I found the cause, however I am not sure what's the best solution.
I noticed that I was not able to use tinymce with wysiwyg module because of an error in jquery.form.js
The first thing I asked myself was why that file was being included in the node edition screen, but it wasn't on every node, just products. I looked at the code and the inclusion of the file in hook_form_alter() seemed fine, by debugging a little bit more I noticed that the add to cart form was indeed being rendered although I was on the edit screen. By further debugging I found that a nodewords function was calling node_build_content() which itself calls the node's view hook and then making the uc_aac module to include the js file.
So the solution can be on the nodewords module or on yours. For what I looked I think it might be simpler on yours but I want to hear your comments. I can think on two different approaches. One is to have an additional way of deciding if the js script should be added or not, like looking at the arg()s element of the path and not include it on the edit screen.
Another solution I found is to fix that particular error on the JS and everything else, although included unnecessary, will work. I think this one is the most straightforward one.
Attached is the patch for that one, just adding one small line seems to fix the issue.
a.=
| Comment | File | Size | Author |
|---|---|---|---|
| uc_aac_jsfix.patch | 493 bytes | hanoii |
Comments
Comment #1
cyu commented#266693: Calls to node_build_content() from nodewords_description_prepare() are causing duplicate loading of node information
Comment #2
hanoiiI don't see much light in the nodewords side of this issue, and I do agree its theirs that break the usual logic rendering, but, what about taking a look at my patch?
a.=
Comment #3
cyu commentedjquery.form.js is a third party library, not a js include written only for this module, which in d6 is included with Drupal core so I don't plan on making any alterations to it.
Comment #4
hanoiiAnd what about some workaround check in the module's code. Something like:
or some variation to it? I am willing to code it and submit a patch.