Ih ave uninstaled my feature that provides an eck entity type in code, as well as uninstalling and reinstalling eck completely. No data exists in any of the eck tables or in the cache table. However, entity_get_info still shows my 2 old eck entity types. I've cleared the cache, flusehed the registry, and tried flushing the eck cache with lots of variations of the following:

eck_flush_caches();
cache_clear_all('entity_types', 'cache_eck', TRUE);
$cached = cache_get("entity_types", 'cache_eck');
dsm($cached);

I can not get the stale entity cache data to go, which makes it impossible to revert a feature, or work with any of these now completely broken entity types and bundles.

Comments

mrfelton’s picture

I managed to get around this by changing the following:

  public static function loadAll($entity_type_name = '', $reset = FALSE){
    static $entity_types;

    if ($reset) {
      $entity_types = NULL;
      // Clear all languages.
      cache_clear_all('entity_types', 'cache_eck', TRUE);
    }

    if (!isset($entity_types)) {
      if ($cached = cache_get("entity_types", 'cache_eck')) {
        $entity_types = $cached->data;
      }
      else {
        $entity_types = array();
        $results = db_select('eck_entity_type', 't')
          ->fields('t', array('name'))
          ->execute();

        foreach($results as $result){
          $name = $result->name;
          $entity_type = new EntityType();
          $entity_type->load('name', $name);
          $entity_types[$name] = $entity_type;
        }
        cache_set("entity_types", $entity_types, 'cache_eck');
      }
    }

    if (!$entity_type_name) return $entity_types;

    if (isset($entity_types[$entity_type_name])) return $entity_types[$entity_type_name];
  }

to

  public static function loadAll($entity_type_name = '', $reset = FALSE){
    static $entity_types;

    if ($reset) {
      $entity_types = NULL;
      // Clear all languages.
      cache_clear_all('entity_types', 'cache_eck', TRUE);
    }

    if (!isset($entity_types)) {
        $entity_types = array();
        $results = db_select('eck_entity_type', 't')
          ->fields('t', array('name'))
          ->execute();

        foreach($results as $result){
          $name = $result->name;
          $entity_type = new EntityType();
          $entity_type->load('name', $name);
          $entity_types[$name] = $entity_type;
        }
        cache_set("entity_types", $entity_types, 'cache_eck');
    }

    if (!$entity_type_name) return $entity_types;

    if (isset($entity_types[$entity_type_name])) return $entity_types[$entity_type_name];
  }

and then running all of my cache clearing code from the last post. That allowed the cache to be reset properly, although clearly its not the solution. I then reverted back to how it was, and reenabled/reverted my features.

joelpittet’s picture

Issue summary: View changes

What that looks like as a diff:

--- public static function loadAll($entity_type_name (Selection)
+++ (clipboard)
@@ -8,10 +8,6 @@
     }
 
     if (!isset($entity_types)) {
-      if ($cached = cache_get("entity_types", 'cache_eck')) {
-        $entity_types = $cached->data;
-      }
-      else {
         $entity_types = array();
         $results = db_select('eck_entity_type', 't')
           ->fields('t', array('name'))
@@ -24,7 +20,6 @@
           $entity_types[$name] = $entity_type;
         }
         cache_set("entity_types", $entity_types, 'cache_eck');
-      }
     }
 
     if (!$entity_type_name) return $entity_types;

legolasbo’s picture

Status: Active » Closed (won't fix)

Closing this issue because 7.x-3.x is unsupported. See #2495527: 3.x Roadmap: Unsupported, do NOT use

Please reopen the issue and move it to the 7.x-2.x branch if it is still/also relevant in 7.x-2.x.