2

I'm using Channel Form to post entries from the front end. It works fine locally, but on the development and production server it isn't working at times: Channel images, WYGWAM, Tagger, and Grid. All but WYGWAM look right (the WYGWAM field shows as a basic text box, not the WYWAMY look) but don't work. If you click on a suggested tag it does not get added, if you click an "add row" icon for a Grid it just takes you to the top of the page.

In console I see the following error whenever it breaks (not when it works):

[Error] SyntaxError: Unexpected token '<' (www.example.com, line 40)

Strange part is it is very inconsistent. It will work fine, then break. Then won't work on any browser (Mac, PC, Chrome/Safari), then will start working again.

I've set up a test account:

username: test@rcdevotee.com

password: eecms

http://www.rcdevotee.com/contribute/model

Feel free to see if it works, doesn't work, and if you see any issues that can help figure it out when it isn't working.

The template does not have jQuery, the form includes it (include_jquery=="yes"). So no double jQuery issues in this case.

If I remove the form altogether I don't get the error I listed above. If I have just the form tags, but no fields it will give the error when it isn't working. So it has something to do with the Channel Form tag and not any of the fields it would seem.

Any help or ideas where to look for help much appreciated.

  • if site online send me message (max at eec.ms) and I will check it – Max Lazar May 22 '14 at 16:41
  • On the situations where it fails is there anything special about the value of EE.THEME_URL? Is line 40 the first line in your code snippet? – AllInOne May 22 '14 at 17:52
  • Make sure your theme folded are uploaded properly and that you do not have any JS errors in your browsers console. – Justin Long Jun 28 '14 at 21:28
  • Something is rendering the '<' in the JS. What are you seeing on line 40 when inspecting the JS with webdev tools? Could be a 404 being returned for something being loaded via JS or PHP inside your JS. – Anna_MediaGirl Jul 1 '14 at 17:05
1

My guess would be that you're including jQuery twice (once in your standard template, once automatically via Channel Form)? Adding the include_jquery="no" parameter would fix it if that is indeed the problem.

http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_form/index.html#include-jquery

| improve this answer | |
  • I don't have JQUery on that page template (I've run into issues with that and did check that), but do have include_jquery="yes". – Doug May 22 '14 at 16:27
0

For what it's worth, I am not able to duplicate your error in FireFox or Chrome on Windows 7.

While looking at the source code, I noticed a couple of issues that will not pass html validation. It's possible one of those is getting in the way. I'd start by validating the html and fixing the issues that it identifies. Might just do the trick!

| improve this answer | |
  • thanks for checking. It has been a very hit and miss error. The page work fine, then suddenly won't work. I have found it tends to fail most when logged in as a Super Admin. If I open an Incognito window and load the page again it will usually start working. – Doug Jun 30 '14 at 23:11
  • Is this only happening on one computer or inside one network? Sounds like a non EE thing and something specific to an external factor. – Anna_MediaGirl Jul 1 '14 at 15:27
  • It is extremely random. It happens on most any system/network. I've seen it at my office and home (different computers) and a user reported it as well. It does seem like a non EE issue. At this point I'll clean up the unvalidated code and see if that helps. – Doug Jul 1 '14 at 19:52
  • I'm confident that this isn't EE related. When it's happening, look at the NET tab in webdev tools. Would show if there is a 404 being rendered for anything. – Anna_MediaGirl Jul 1 '14 at 20:29
0

I had this same issue and discovered that having Output Profiler and Template Debugging set to 'On' created additional elements that caused the syntax errors that broke my Grid.

The good news is that no public or non-Super Admin account would see this.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.