This in multi_node_edit_form() looks wrong:

return system_settings_form($form);

1. It puts buttons for 'save configuration' and 'reset to defaults' on the multi node form -- those labels look wrong.

2. Second, it will cause EVERY field in the form to save itself as a system variable. Given the entire package has only two calls to variable_get(), I doubt this is what is meant.

CommentFileSizeAuthor
#2 empty placeholder-1.png9.85 KBtexas-bronius

Comments

texas-bronius’s picture

@joachim: I'm new to this module, but I'd guess you're correct: Would make more sense to replace system_settings_form by adding a simple Save button to the form and be done with it, right?

texas-bronius’s picture

StatusFileSize
new9.85 KB

Thinking out loud here: To address @Joachim's reported issue, I changed a couple lines to:

$buttons = NULL;
foreach (...) {
  ...
    // Unset the individual form's buttons so they can't be submitted except by our buttons.
    $buttons = $form['nodes'][$ref->nid]['form_'. $ref->nid]['buttons'];   // added this
    unset($form['nodes'][$ref->nid]['form_'. $ref->nid]['buttons']);

and then at the bottom:

  $form['buttons'] = $buttons;
  ...
  return $form;

This appears to work (gets rid of system config buttons and submit handler, adds original buttons from the last node in the chain), but I don't get why it's not reflected in the theme: In my particular theme, the action buttons are always repeated from the bottom of the screen, again at the top-right of the screen. Any tips why it's not happening here? There's still an empty placeholder up there:
empty placeholder
The system_settings_form() method did show duplicate buttons as expected.

joachim’s picture

It's a long time since I filed this so I don't really remember, but you definitely shouldn't be using system_settings_form() at all. Instead you should have a custom save handler. Not sure about your problem with buttons, sorry.

a_c_m’s picture

texas-bronius’s picture

I feel ill-placed time chipping away on a D6 project ;) but limelight welcome all the same! I should add that recently I found it didn't make sense to keep the "Delete" button that comes with the first node in the stack (whence the $buttons are derived). It might be a local business case decision what to do with it, but for me, I swapped Delete for a new Cancel button and its own custom action (I think it just goes back to the drupal_get_destination destination... don't recall offhand).

Merry Christmas!