PDOException : SQLSTATE[42S02]: Base table or view not found: 1146 Table '[__BD__].menu_token' doesn't exist: SELECT t.* FROM {menu_token} t WHERE (t.mlid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 2 ) in menu_token_get() (line 32 in .../sites/all/modules/menu_token/menu_token.inc).

I had this error with alpha 2, upgrading to last dev helped me get rid of it.

Comments

Status: Fixed » Closed (fixed)

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

drupal_jon’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.0-alpha3
Status: Closed (fixed) » Active

This still seems to be preventing updates in version 7.x.-1.0-alpha3 when upgrading from prior versions. I've fixed in my case by wrapping the contents of menu_token_update_7002() inside an if statement like so:

/**
 * Implements hook_update_N().
 */
function menu_token_update_7002(&$sandbox) {
  if (db_table_exists('menu_token')) {
    ...
  }
}
dealancer’s picture

So did you had this issue when updating from the alpha1 or alpha2?

darioshanghai’s picture

Same issue here, upgrading from alpha1. Doesn't seem to affect the module functionality.

areynolds’s picture

Why isn't there a hook_schema call in alpha3 (or, for that matter, the dev version) of the module? Shouldn't the schema be defined in hook_schema, and updates to previous versions handled in the hook_update_N implementation?

dealancer’s picture

Status: Active » Closed (won't fix)

We removed the hook_schema implementation from the alpha 3, cause we don't need it now. The menu token options are stored in the menu_item's table options field in the database, so it uses Drupal core table.

I am closing this issue. If update will throw error, please try to delete menu_token table (this may affect on some menu token settings data loss), if it does not help, update status of this issue to 'needs work'.