1

I'm utilizing the Field Collection module to allow me to associate objects of one content type (say, Authors) with another content type (say, Books).

When viewing the Edit page for one of my specific Book objects, whenever I try to use the "Add another item" or "Remove" buttons within the Authors section -- which operate via Ajax -- I'm getting an Ajax "403 Forbidden" error on the following URL:

field_collection/ajax

One key piece of information is that this happens with only one specific object; the functionality of those buttons works perfectly fine on the edit pages of other Books.

When I visit the Recent Log Messages page -- admin/reports/dblog -- it displays the following error message:

Notice: Undefined index: form_build_id in ajax_get_form() (line 320 of .../includes/ajax.inc).

I checked though, and the form_build_id does, in fact, appear to be included with the POST data being submitted to field_collection/ajax.

Is it possible that that form_build_id is somehow invalid?

I'm sort of at a loss here. Any thoughts?

UPDATE:

I set up watchdog to log the POST data, and it seems like there's absolutely no data available in $_POST once it hits the field_collection_remove_js function within the Field Collection module code...

Is there a chance I'm hitting some sort of POST length/size limit? The node in reference does, in fact, have a whole bunch of data associated with it.

  • If you have access to the database, get the node id of the book that is having the problem. Next look at the field_data_YOUR_FIELD_COLLECTION_NAME table and find where the reference id equals your book id. I've had a problem in the past with field collections getting deleted but still showing on the node. – FatGuyLaughing Aug 14 '14 at 14:36
  • I just recreated the entire problematic node by hand, and the same Ajax errors started occurring again after adding ~20 associated field collection nodes to it. So it shouldn't have anything to do with missing database entries. – Alex Coleman Aug 14 '14 at 15:23
  • I've been caught out before by going beyond max_input_vars. Here's an explanation of why it exists. Dunno if that's what's going on here tho... – Andy Aug 15 '14 at 10:04
0

In case it helps anyone else, I believe I was running into memory limit issues in PHP. Adding the following to my sites/default/settings.php seems to have resolved the issue:

ini_set('memory_limit', '128M');

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.