After uploading an image and pressing the Submit-Button I get this:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'usr_web339_2.cache_entity_asset' doesn't exist: DELETE FROM {cache_entity_asset} WHERE (cid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 1 ) in cache_clear_all()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

romansta’s picture

Title: Errror: Missing table "cache_entity_asset" after submit » Missing table "cache_entity_asset" after submit
corentin.crouvisier’s picture

Same issue with the version 7.x-1.0-beta4

corentin.crouvisier’s picture

Hi, same problem for me with 7.x-1.0-beta4 when I edit a media and that I save/delete it after (from /admin/content/assets).
Line 116 changing $return['asset']['entity cache'] = TRUE; to $return['asset']['entity cache'] = FALSE; from asset.module in function asset_entity_info() and after clear cache solve the problem.

kiseleva.t’s picture

Hi,

As described here: https://www.drupal.org/node/1387268#comment-6983504, each module should create this table it manually.
This patch should fix this problem, it's created necessary table.

IRuslan’s picture

Status: Active » Needs work

Tatiana, thanks for patch. It's actually works.
But the single problem that even for users without entity cache enabled additional table will be created.
What I propose is to get inspiration from the approach in bean module.
We should create sub-module like bean_entitycache. And move table creation into .install file of the submodule.
Additionally, it will allow us to move this snippet

// Support entity cache module.
  if (module_exists('entitycache')) {
    $return['asset']['field cache'] = FALSE;
    $return['asset']['entity cache'] = TRUE;
  }

into entity_info_alter of the submodule.
To be sure if previous versions not affected, we need to add enabling of submodule in hook_update if entitycache enabled.
As improvement we also should add same condition into hook_install — and make submodule enabled for fresh installs if entitycache enabled.

kiseleva.t’s picture

Ruslan, thank you for your answer.
Please check new patch attached.

IRuslan’s picture

Status: Needs work » Fixed

Great work! Pushed to dev.

  • IRuslan committed 1a73d2b on 7.x-1.x authored by kiseleva.t
    Issue #2129587 by kiseleva.t, romansta, IRuslan: Missing table "...

Status: Fixed » Closed (fixed)

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