Token issue - form outdated with drupal_render($form['my_field'])

Created on 16 April 2014, over 10 years ago
Updated 8 July 2024, 5 months ago

When using entityconnect in a form with a custom template, clicking on the "New content" link causes a "The form has become outdated. Please reload this page." error. The form for the new content is not loaded.

The following will work inside of my_content_type-node-form.tpl.php:
drupal_render_children($form)

However, the error occurs if the fields are displayed individually, as in the following:

print drupal_render($form['form_build_id']);
print drupal_render($form['form_id']);
print drupal_render($form['my_entity_connect_field']);
print drupal_render($form['actions']);

As a workaround, it seems to work if I add $form['#token'] = NULL; to my hook_form_alter() function.

I tried to figure out why, but I'm afraid I couldn't. Thank you for your great work on this module.

πŸ› Bug report
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jbova

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024