technonaturalist

image link to hive image link to ko-fi

Drupal 7 notes - forms with file field reloading page without going through form validation

posted on: Tuesday, 11 March 2014 @ 1:09pm in

I had a problem shortly after setting up ownCloud and Piwik where forms on all of the Drupal sites on my server mysteriously stopped working.

But not all of them, only the ones with a file field. When hitting the submit button on those forms (and it didn’t matter what the form was, the presence of a file field was enough) the form validate wouldn’t trigger, the page would simply reload.

After much stuffing around and frustration, I found the problem was related to the max filesize and max upload limits in php.ini were set to 2G. Changed them to a much more managable 100M and all is well with the world.

Moral of the story: don’t mess around with php.ini in the middle of the night after not sleeping properly for two weeks.