Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

I'm trying to use Couch for a website, but hit this obstacle. When running a page, I get:
ERROR! ATTRIB_NAME: Invalid char "'" (line: 331 char: 22316)

Common sense and a google that referred me here would suggest that there's a ' too many. On line 331 however, there's nothing but <div class="someclass">

I ran it through some php checkers, but that doesn't reveal any mistakes either. I can't search for the character, as there are thousands of them, just reading is near-impossible for sheer numbers. Any idea on how to find this?
I think both the line and char count start from after the first Couch PHP statement. The problem could be on line 332 or later depending on how much white space you used. You should download a text-editor like Notepad++ which can count the number of characters in a selection. This way you could quite easily find the problematic 22,317th character.
Admittedly, the location of the syntax error as reported by Couch is not as helpful as one would have wished it to be.
However, the reason for the error normally yields sufficient clue.

Since the error reported can only belong to Couch tags (i.e. those starting with cms:), in your case please try finding the Couch tag that has a "'" in one of its parameter.

TIP: Since Couch does not have a debugger, while working with it, it is always a sane strategy not to add too many tags/blocks at the same time before testing the page. Idea is to add only a couple of Couch statements at a time, refresh template to see if the added statements do their job. If an error gets thrown, instead, we'll know exactly which tags could be those involved in it.
3 posts Page 1 of 1