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.

CommentFileSizeAuthor
#2 fix_node_type_form_0.diff2.34 KBpwolanin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

profix898’s picture

Status: Active » Closed (duplicate)

Marking this 'duplicate'. It will be fixed by the patch in issue http://drupal.org/node/88633

pwolanin’s picture

Assigned: Unassigned » pwolanin
Status: Closed (duplicate) » Needs review
FileSize
2.34 KB

following on from http://drupal.org/node/88633#comment-159094

Attached patch should fix the problem in the $form building phase

pwolanin’s picture

Title: per node type settings of upload.module broken for books » per node type settings form broken for book, other module-defined types

trying 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.

chx’s picture

Status: Needs review » Reviewed & tested by the community

As it happened with #node so it happens with #node_type . I like the solution (but I am biased because I suggested it...)

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)