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.
Attachment functionality of upload.module can be enabled on a per-nodetype basis (radio button on node_type_form). But actually the settings are not displayed correctly for books. The problem is in hook_form_alter() the following code gets the current state variable_get('upload_'. $form['identity']['type']['#default_value'], 1)
, but for books the node type is in $form['identity']['type']['#value']
(for other node types, e.g. page/story it in $form['identity']['type']['#default_value']
). Not sure where the issue is located exactly, but I guess it is in book.module or node type system.
Comment | File | Size | Author |
---|---|---|---|
#2 | fix_node_type_form_0.diff | 2.34 KB | pwolanin |
Comments
Comment #1
profix898 CreditAttribution: profix898 commentedMarking this 'duplicate'. It will be fixed by the patch in issue http://drupal.org/node/88633
Comment #2
pwolanin CreditAttribution: pwolanin commentedfollowing on from http://drupal.org/node/88633#comment-159094
Attached patch should fix the problem in the $form building phase
Comment #3
pwolanin CreditAttribution: pwolanin commentedtrying to clarify the title.
To reiterate: the bug can be observed when setting the comment or upload settings for any module-defined type. The correct settings are saved to the variables table. However, when editing the node type again the correct default values (the current settings) do not appear in the node type editing form.
Comment #4
chx CreditAttribution: chx commentedAs it happened with #node so it happens with #node_type . I like the solution (but I am biased because I suggested it...)
Comment #5
drummCommitted to HEAD.
Comment #6
(not verified) CreditAttribution: commented