0

I am using the Entity Reference View widget. But having some issues with it.

The widget is showing up with a Add Item button on the node creation form, however when i click on that Add Item button it throws an ajax error which i am posting below:

This happens only for the front end version of the node creation form where the user does not have access to the admin theme and the user is presented with the node creation form using the Bartik theme.

But if i click on that Add Item button from the admin version of the node creation form the modal window appears.

The ajax error output:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /drupal/system/ajax
StatusText: OK
ResponseText: string(18) "activity_node_form"
string(38) "entityreference_view_widget_modal_form"
[{"command":"settings","settings":{"basePath":"\/drupal\/","pathPrefix":"","ajaxPageState":{"theme":"bartik","theme_token":"6j38qKKVNPN5klA-SwBBSrbDCPUHdBtZhm24TI-uqD4","js":{"sites\/all\/modules\/contrib\/views\/js\/base.js":1,"sites\/all\/modules\/contrib\/views\/js\/ajax_view.js":1}},"datePopup":{"edit-field-due-date-und-0-value--2-datepicker-popup-0":{"func":"datepicker","settings":{"changeMonth":true,"changeYear":true,"autoPopUp":"focus","closeAtTop":false,"speed":"immediate","firstDay":0,"dateFormat":"mm\/dd\/yy","yearRange":"+0:+3","fromTo":false,"defaultDate":"0y"}},"edit-field-due-date-und-0-value--2-datepicker-popup-1":{"func":"datepicker","settings":{"changeMonth":true,"changeYear":true,"autoPopUp":"focus","closeAtTop":false,"speed":"immediate","firstDay":0,"dateFormat":"mm\/dd\/yy","yearRange":"+0:+3","fromTo":false,"defaultDate":"0y"}}},"CToolsModal":{"loadingText":"Loading...","closeText":"Close Window","closeImage":"\u003Cimg typeof=\u0022foaf:Image\u0022 src=\u0022http:\/\/localhost\/drupal\/sites\/all\/modules\/contrib\/ctools\/images\/icon-close-window.png\u0022 alt=\u0022Close window\u0022 title=\u0022Close window\u0022 \/\u003E","throbber":"\u003Cimg typeof=\u0022foaf:Image\u0022 src=\u0022http:\/\/localhost\/drupal\/sites\/all\/modules\/contrib\/ctools\/images\/throbber.gif\u0022 alt=\u0022Loading\u0022 title=\u0022Loading...\u0022 \/\u003E"},"views":{"ajax_path":"\/drupal\/views\/ajax","ajaxViews":{"views_dom_id:3133a30022520ec477a4278110a71fcb":{"view_name":"tester_view","view_display_id":"entityreference_view_widget_1","view_args":"","view_path":"system\/ajax","view_base_path":null,"view_dom_id":"3133a30022520ec477a4278110a71fcb","pager_element":0}}},"ajax":{"edit-button-add":{"callback":"entityreference_view_widget_ajax","event":"mousedown","keypress":true,"prevent":"click","url":"\/drupal\/system\/ajax","submit":{"_triggering_element_name":"op","_triggering_element_value":"Submit"}}}},"merge":true},{"command":"insert","method":"prepend","selector":"head","data":"\u003Cscript type=\u0022text\/javascript\u0022 src=\u0022http:\/\/localhost\/drupal\/sites\/all\/modules\/contrib\/views\/js\/base.js?n4lxu8\u0022\u003E\u003C\/script\u003E\n\u003Cscript type=\u0022text\/javascript\u0022 src=\u0022http:\/\/localhost\/drupal\/sites\/all\/modules\/contrib\/views\/js\/ajax_view.js?n4lxu8\u0022\u003E\u003C\/script\u003E\n","settings":null},{"command":"modal_display","title":"tester view","output":"\u003Cform action=\u0022\/drupal\/system\/ajax\u0022 method=\u0022post\u0022 id=\u0022entityreference-view-widget-modal-form\u0022 accept-charset=\u0022UTF-8\u0022\u003E\u003Cdiv\u003E\u003Cdiv class=\u0022view view-tester-view view-id-tester_view view-display-id-entityreference_view_widget_1 view-dom-id-3133a30022520ec477a4278110a71fcb\u0022\u003E\n        \n  \n  \n      \u003Cdiv class=\u0022view-content\u0022\u003E\n      \u003Ctable class=\u0022views-table cols-0\u0022 \u003E\n       \u003Ctbody\u003E\n          \u003Ctr class=\u0022odd contextual-links-region views-row-first\u0022\u003E\n                  \u003Ctd class=\u0022views-field views-field-title\u0022 \u003E\n            lead for areeb 1          \u003C\/td\u003E\n                  \u003Ctd class=\u0022views-field views-field-contextual-links\u0022 \u003E\n                      \u003C\/td\u003E\n              \u003C\/tr\u003E\n          \u003Ctr class=\u0022even contextual-links-region\u0022\u003E\n                  \u003Ctd class=\u0022views-field views-field-title\u0022 \u003E\n            lead two          \u003C\/td\u003E\n                  \u003Ctd class=\u0022views-field views-field-contextual-links\u0022 \u003E\n                      \u003C\/td\u003E\n              \u003C\/tr\u003E\n          \u003Ctr class=\u0022odd contextual-links-region views-row-last\u0022\u003E\n                  \u003Ctd class=\u0022views-field views-field-title\u0022 \u003E\n            lead one          \u003C\/td\u003E\n                  \u003Ctd class=\u0022views-field views-field-contextual-links\u0022 \u003E\n                      \u003C\/td\u003E\n              \u003C\/tr\u003E\n      \u003C\/tbody\u003E\n\u003C\/table\u003E\n    \u003C\/div\u003E\n  \n  \n  \n  \n  \n  \n\u003C\/div\u003E\u003Cinput id=\u0022ervw-modal-form-selected-entity-ids\u0022 type=\u0022hidden\u0022 name=\u0022selected_entity_ids\u0022 value=\u0022\u0022 \/\u003E\n\u003Cdiv class=\u0022entityreference-view-widget-modal-submit form-wrapper\u0022 data-table-id=\u0022field-lead-values\u0022 id=\u0022edit-submit--3\u0022\u003E\u003Cinput class=\u0022button form-submit\u0022 type=\u0022submit\u0022 id=\u0022edit-button-add\u0022 name=\u0022op\u0022 value=\u0022Submit\u0022 \/\u003E\u003C\/div\u003E\u003Cinput type=\u0022hidden\u0022 name=\u0022form_build_id\u0022 value=\u0022form-iY6e3YhFi5F8G4fqw1e0aetgY3uHlKlZ9CwzGhgRj5A\u0022 \/\u003E\n\u003Cinput type=\u0022hidden\u0022 name=\u0022form_token\u0022 value=\u0022_qcVVA7uU-ngfULgfXXYi7_tAAHXOwVlefqAj6QAIJ8\u0022 \/\u003E\n\u003Cinput type=\u0022hidden\u0022 name=\u0022form_id\u0022 value=\u0022entityreference_view_widget_modal_form\u0022 \/\u003E\n\u003C\/div\u003E\u003C\/form\u003E"}]

closed as off-topic by Mołot, Yusef Mohamadi, mpdonadio Aug 27 '15 at 19:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced, was solved by a cache clear, or was a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." – mpdonadio
If this question can be reworded to fit the rules in the help center, please edit the question.

1

Found the issue mintues after posting the question..

It turns out i had var_dump being used in my template.php and it was causing the error.

I also tried disabling some development related modules such as Deve, as i read in some other questions where people had similar issues. Just wanted to post this here for future reference and anyone else who comes across it.

  • Development off in the modules section helped me. thanks a ton! – jasonflaherty Nov 3 '14 at 4:05
  • @jasonflaherty : Anytime :) Glad it helped you :) – Zubair1 Nov 7 '14 at 7:16

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