Javascript error on Mass delete

Status
Not open for further replies.

stratacorps

New Member
I have a simple list form and using the Fabrik List menu, and if I select to delete a record (individually or multiple select), I get a javascript error after the records are deleted and thus the endless spinner "Loading..." appears.

The ajax call is getting text back in front of the JSON string, but I can't find out where its coming from.

The Uncaught error appears...
Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.onComplete (list.js:3)
at Object.<anonymous> (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:42)
at Array.forEach (<anonymous>)
at Function.forEach (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:5)
at Array.each (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:9)
at Object.fireEvent (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:42)
at Object.e.extend.$owner (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:38)
at Object.onSuccess (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:160)
at Object.e.extend.$owner (mootools-core.js?592bddaf846dd52c72d37bcc282c3126:38)

And the JSON response text is
<br /><br />{"id":"4","listRef":"4_com_jevents_4","rowid":"","model":"list","data":[[]],"headings":{"events_virtual_results___id":"Id","events_virtual_results___fullname":"Participant","events_virtual_results___entry_date":"Date","events_virtual_results___entry_time":"Time","events_virtual_results___entry_distance":"Distance","fabrik_select":"<input type=\"checkbox\" name=\"checkAll\" class=\"list_4_checkAll\" id=\"list_4_checkAll\" \/>","fabrik_actions":""},"formid":"4","lastInsertedRow":"test","nav":{"url":"\/events\/314\/test-run-for-your-life?resetfilters=0&amp;clearordering=0&amp;clearfilters=0","showTotal":"1","showAllOption":"1","showDisplayNum":"1","viewAll":false,"limitstart":0,"limit":10,"total":0,"prefix":"","pagesStart":1,"pagesStop":0,"pagesCurrent":1,"pagesTotal":0,"hideEmptyLimitstart":false,"showNav":"1","startLimit":"10"},"htmlnav":"<div class=\"list-footer\">\r\n\t<div class=\"limit\">\r\n\t\t<div class=\"input-prepend input-append\">\r\n\t\t\t<span class=\"add-on\">\r\n\t\t\t\t<label for=\"limit4\">\r\n\t\t\t\t\t<small>\r\n\t\t\t\t\tDisplay #\t\t\t\t\t<\/small>\r\n\t\t\t\t<\/label>\r\n\t\t\t<\/span>\r\n\t\t\t<select id=\"limit4\" name=\"limit4\" class=\"inputbox input-mini\" size=\"1\" onchange=\"\">\n\t<option value=\"5\">5<\/option>\n\t<option value=\"10\" selected=\"selected\">10<\/option>\n\t<option value=\"15\">15<\/option>\n\t<option value=\"20\">20<\/option>\n\t<option value=\"25\">25<\/option>\n\t<option value=\"30\">30<\/option>\n\t<option value=\"50\">50<\/option>\n\t<option value=\"100\">100<\/option>\n\t<option value=\"-1\">all<\/option>\n<\/select>\n\t\t\t<span class=\"add-on\">\r\n\t\t\t\t<small>\r\n\t\t\t\t\t Total: 0\t\t\t\t<\/small>\r\n\t\t\t<\/span>\r\n\t\t<\/div>\r\n\t<\/div>\r\n\t\t<input type=\"hidden\" name=\"limitstart4\" id=\"limitstart4\" value=\"0\" \/>\r\n<\/div>\r\n","calculations":{"sums":[],"avgs":[],"medians":[],"count":[],"custom_calc":[]},"hasFilters":false,"searchallvalue":""}

Any help tracking down the "<br /><br />" that is prepended to the JSON response?

Thanks
 
Last edited:
Is this all what is prepended? Ususally it's some php error/notice/warning creating the "unexpected token".

Is this in frontend and backend?
Standard Fabrik list template?
Any list plugins?
 
Thank you. No list plugins. I just turned off Ajaxify, same result. There is nothing else, the console shows the error, and when I follow the source I get that. There are no other errors in the console.

I thought it was because I had the list embedded in another module, but this is happening with a direct menu link.

In the page source, I can see the <br /><br /> text--assuming its part of the page or template, but not sure why its being included in the ajax response text...

<div class="platform-content row-fluid"><div class="span12"><br /><br /> <div class="page-header">
<h1>Your Virtual Results</h1>
</div><form class="fabrikForm form-search" action="/virtual-results-listing?resetfilters=0&amp;clearordering=0&amp;clearfilters=0" method="post" id="listform_4_com_fabrik_4" name="fabrikList">...

Edit: sorry, forgot. This does not happen in the backend.
 
If it's not in the backend and you have the same Fabrik list template (default is bootstrap) in front- and backend then it seems related to your Joomla template or some 3rd-party plugin.
 
Yeah, I've switched templates to a plain, content only I use for debugging and the Beeze J! template. So I know the template isn't getting in the way. I just don't know where to go to try to find out who (and why) they are inserting the breaks...and why Fabrik is including the content on the response.
 
(removed duplicate answer).

Found it. Sorry my first post had to be me being a total noob . I had a PHP script running on one of the fields to create a dropdown and a comment was getting in the way. Removed the comment, and everything is working (again). Thanks for listening. (Note: turning on the debug helped, because I got a message about an eval'd statement throwing another error that led me to that specific field element)
 
Glad you found it.
You can close solved threads by unchecking "open" in Thread Tools.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top