Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Nodes order weights are not reloaded with submitted values when Entity Cache module is enabled.
Entity cache has to be reset after updating the taxonomy_index table.
To resolve this problem, I added some ligne to nodeorder.admin.inc:
function nodeorder_admin_display_form_submit($form, &$form_state) {
$tid = $form['#term']->tid;
$ids = array();
foreach ($form_state['values'] as $nid => $node) {
// Only take form elements that are blocks.
if (is_array($node) && array_key_exists('weight', $node)) {
db_update('taxonomy_index')->fields(array('weight' => $node['weight']))
->condition('tid', $tid)
->condition('nid', $nid)
->execute();
$ids[] = $nid;
}
}
drupal_set_message(t('The node orders have been updated.'));
if (module_exists('entitycache')) {
cache_clear_all($ids, 'cache_entity_node');
}
cache_clear_all();
return;
}
Comment | File | Size | Author |
---|---|---|---|
#2 | 2684301-2-invalidate-entitycache.patch | 1006 bytes | greggadsdon |
Comments
Comment #2
greggadsdon CreditAttribution: greggadsdon at ComputerMinds commentedI've attached a patch. I've cleared the cache using a broader method as it could clear other caching systems too, but it does clear entitycache as above.
Comment #3
davps CreditAttribution: davps as a volunteer and at DrupalJedi commented