This is happening on 3 separate Drupal sites that I've recently added Form Filter to. I choose to hide the 'authored by' information, and when someone edits a node and resubmits, the author field becomes blank. It's a logistical nightmare in some cases where I have to go back and try to figure out what users created what nodes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kongoji’s picture

subscribing.

momper’s picture

same problem - subscribe

kongoji’s picture

Also the "Authored on" field has the same issue. It becomes blank, so on node edit Drupal updates the node creation date, not the node modified date, as it should be.

yingtho’s picture

Status: Active » Needs review

I have found the problem and it regards to all fields that is hidden by form filter. The problem is that the field is removed rather than hidden the problem lies in line 130 for 6.x-1.0 and line 126 for 6.x-1.x-dev. See below.

// Set final form of array.
if ($value) {
$element += array(
- '#type' => 'value',
+ '#type' => 'hidden',
'#value' => $value,
);
}

yingtho’s picture

Also in line 117 (6.x-1.0): add two lines:
// nested form elements (element_children).
foreach (element_properties($element) as $key) {
switch ($key) {
case '#tree':
+ case '#id':
+ case '#name':
continue;
default:
unset($element[$key]);
}
}

Then the elements comes out as hidden values that will save the values under node save.

adeb’s picture

yingtho thank you for providing this fix.
I hope this can the integrated in the next release.

dddave’s picture

Status: Needs review » Needs work

Hi guys,

submitting a patch increases the chances of this issue getting fixed soon. See: http://drupal.org/patch/create if you are not familiar with this process. I am not using this module btw. in case you ask why I don't do it myself.

capsicumpie’s picture

subscribe

capsicumpie’s picture

Status: Needs work » Needs review
FileSize
611 bytes

on the advice of dddave I've attempted to generate a patch for this using yingtho's fix.

jju’s picture

Status: Needs review » Reviewed & tested by the community

Work fine for me! I hope that maintainer can create the new release asap.

Thanks!

Eaglecanada’s picture

Applied the patch, not working. When hide the authoring information, author set to anonymous.
any setting in other area I miss? user permission "administer nodes" allow. caches clear. still not working.

any ideas?

sachbearbeiter’s picture

... still not working for me too

pianomansam’s picture

Status: Reviewed & tested by the community » Needs work

Patch in #9 does not seem to be working for me. In addition, it appears to be messing up the Polls.module create/edit form.

Side note, is this module even being maintained any more?

yvmarques’s picture

FileSize
917 bytes

I had the same issue and try to investigate it deeper and as I understood seems to be that the #type='value' is not added as $form_state['values']. The following patch fixed the problem for me.

Also, I noticed that happen when the user as 'administer nodes' permission.

castawaybcn’s picture

Status: Needs work » Reviewed & tested by the community

patch in #14 worked beautifully and fixed #1704070: Hidden required fields do not get default value and return error as well.