Currently, these are rendered by the "main" form. This causes a problem if you do not want to use that form. If you want to arrange CCK-Fields freely, for example.

(I have a CCK-widget-form plugin, but it's a bit rough)

Comments

merlinofchaos’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

I'm not entirely sure about this but I can't see anything wrong with it, so committing.

merlinofchaos’s picture

Status: Patch (to be ported) » Closed (duplicate)

All of the 'to be ported' patches got merged in during the porting sprint in September.

emattias’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new739 bytes

This creates a notice when anonymous users load a form where the nod buttons are placed individually.

I have traced it to this code in form.inc:


  // Add a token, based on either #token or form_id, to any form displayed to
  // authenticated users. This ensures that any submitted form was actually
  // requested previously by the user and protects against cross site request
  // forgeries.
  // This does not apply to programmatically submitted forms. Furthermore, since
  // tokens are session-bound and forms displayed to anonymous users are very
  // likely cached, we cannot assign a token for them.
  // During installation, there is no $user yet.
  if (!empty($user->uid) && !$form_state['programmed']) {
    // Form constructors may explicitly set #token to FALSE when cross site
    // request forgery is irrelevant to the form, such as search forms.
    if (isset($form['#token']) && $form['#token'] === FALSE) {
      unset($form['#token']);
    }
    // Otherwise, generate a public token based on the form id.
    else {
      $form['#token'] = $form_id;
      $form['form_token'] = array(
        '#id' => drupal_html_id('edit-' . $form_id . '-form-token'),
        '#type' => 'token',
        '#default_value' => drupal_get_token($form['#token']),
      );
    }
  }

It doesn't set $form['form_token'] for anonymous users.

This patch adds a check that something isset in the $context before trying to add it to the $block(in node_form_buttons.inc).

merlinofchaos’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.