Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#14 | 790978-author-anon-1.patch | 917 bytes | yvmarques |
#9 | formfilter_hide_dont_remove.patch | 611 bytes | capsicumpie |
Comments
Comment #1
kongoji CreditAttribution: kongoji commentedsubscribing.
Comment #2
momper CreditAttribution: momper commentedsame problem - subscribe
Comment #3
kongoji CreditAttribution: kongoji commentedAlso 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.
Comment #4
yingtho CreditAttribution: yingtho commentedI 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,
);
}
Comment #5
yingtho CreditAttribution: yingtho commentedAlso 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.
Comment #6
adeb CreditAttribution: adeb commentedyingtho thank you for providing this fix.
I hope this can the integrated in the next release.
Comment #7
dddave CreditAttribution: dddave commentedHi 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.
Comment #8
capsicumpie CreditAttribution: capsicumpie commentedsubscribe
Comment #9
capsicumpie CreditAttribution: capsicumpie commentedon the advice of dddave I've attempted to generate a patch for this using yingtho's fix.
Comment #10
jju CreditAttribution: jju commentedWork fine for me! I hope that maintainer can create the new release asap.
Thanks!
Comment #11
Eaglecanada CreditAttribution: Eaglecanada commentedApplied 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?
Comment #12
sachbearbeiter CreditAttribution: sachbearbeiter commented... still not working for me too
Comment #13
pianomansam CreditAttribution: pianomansam commentedPatch 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?
Comment #14
yvmarques CreditAttribution: yvmarques commentedI 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.
Comment #15
castawaybcn CreditAttribution: castawaybcn commentedpatch in #14 worked beautifully and fixed #1704070: Hidden required fields do not get default value and return error as well.