subform.module contains the following comments:

    // TODO prevent caching in drupal_rebuild_form() as we are doing it later
    // in subform_parent_after_build().

My site is suffering from bad performance because it executes many cache_set calls while rebuilding.

Will the following code prevent caching the right way?

    $nocache = !empty($subform_state['no_cache']);
    $subform_state['no_cache'] = TRUE;
    $element['#subform'] = drupal_rebuild_form($element['#subform_id'], $subform_state, $old_subform);
    $subform_state['no_cache'] = $nocache;
CommentFileSizeAuthor
#1 subform-nocache-2370143-1.patch725 bytesJorrit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jorrit’s picture