Fixing FileField, part 2.

No idea if the "Add more items" works for other people with JavaScript disabled, but it doesn't work for me because form_execute_handlers() in form.inc doesn't find the content_add_more_submit() function when it should be called. Which means that content.node_form.inc isn't included at the time when drupal_process_form() wants to submit the form. This makes the button pretty much a no-op, and no new item is added.

This *could* be solved by moving content_add_more_submit() to content.module (works, I tried it) but before suggesting to do so, I'll rather dive into the form building process in order to understand why the element exists in the form apparently without content_form_alter() being called (and including content.node_form.inc).

CommentFileSizeAuthor
#2 cck-multiple-value-fix-addmore.diff2.96 KBjpetso

Comments

jpetso’s picture

Component: General » content.module

Provide a more specific component for this issue.

jpetso’s picture

Status: Active » Needs review
StatusFileSize
new2.96 KB

Ok, here's a patch solving the submit function and its item count issues, which in turn required to solve the item count issues of the JavaScript add-more functionality as well. This stuff can't possibly have worked before. It should *nearly* work now (without regressions compared to before), so please test and apply if it's ok.

This patch builds on my previous one (#273476: 3F #1: Fix item count for "Add more") so one or two hunks might fail or fuzz if you don't have that one applied. The patches are logically separate and this one should also work without the other one, but I can't guarantee that as they both touch item count issues. Tested in combination, and works pretty nice this way.

jpetso’s picture

Rolled into a combined patch with 3F issues #1 and #4, see http://drupal.org/node/274038#comment-893832

yched’s picture

Status: Needs review » Closed (duplicate)