PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxx.profile_type' doesn't exist: SELECT p.* FROM {profile_type} p; Array ( ) in profile2_entity_info() (line 46 of profile2.module)

Comments

scuba_fly’s picture

Version: 7.x-1.x-dev » 7.x-1.2
Priority: Normal » Major

having the same issue after downloading 7.x-1.2 and enabling it.
Whole site stops from functioning and can't enable or disable any module anymore.
changing it to a major issue because after installing this module you can't use your site anymore and it occurs with the 1.2 ( latest non dev version )

Only way to get site using again is removing the profile2 directory on your server.

david.gil’s picture

Same here also in dev version in a new installation.

Database tables in profile2_schema are not being created.

david.gil’s picture

It not happens in a clean D7... :((

Ashlar’s picture

I encountered this problem after installing this patch in post #89 to several .inc files in the Core to hopefully fix the my Profile2 issue which relates to another Profile2 issue

After manually placing the patch I download and enable Profile 2 (Jan 3 version), but now get this error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'crhub.profile_type' doesn't exist: SELECT p.* FROM {profile_type} p; Array ( ) in profile2_entity_info() (line 46 of C:\Documents and Settings\Compaq_Administrator\My Documents\_web\CR\sites\all\modules\profile2\profile2.module).

socialnicheguru’s picture

@David.gil mine was a clean D7 install

g76’s picture

same here fresh install 7.10

markwk’s picture

I had a similar issue with profile2 error crashing an installation profile. I've removed a ton of the modules from the installation profile including some features that have profile2 + fields. I'm still debugging forward. But my feeling is that this not a simple error with profile2 but an interaction with other stuff.

markwk’s picture

Ok. The installation issue in my case was related to UUID. Upgrades to latest versions seems to have fixed the error on installation

wbobeirne’s picture

Still getting this issue. Tried downloading latest UUID, nothing happened. I never even had the module enabled in the first place.

rlmumford’s picture

I seem to find that this happens if I enable profile2 with drush, but is less likely to happen if I enable it through the UI.

In particular if you have any module that defines an entity with bundles in a similar way to profile2 i.e.

.
.
.
// Add bundle info but bypass entity_load() as we cannot use it here.
  $types = db_select('entity_bundle_table', 'p')
    ->fields('p')
    ->execute()
    ->fetchAllAssoc('type');

  foreach ($types as $type => $info) {
    $return['entity_type']['bundles'][$type] = array(
      'label' => $info->label, 
      'admin' => array(
        'path' => 'admin/structure/profiles/manage/%profile2_type', 
        'real path' => 'admin/structure/profiles/manage/' . $type, 
        'bundle argument' => 4, 
        'access arguments' => array('administer profiles'),
      ),
    );
  }
.
.
.

enabling this module with module_enable() will cause this problem.

I've noticed this with at least 2 modules that implement bundles this way. This happens frequently when the module is installed with drush, but it has also occurred when the call to module_enable() is inside another module's update hook.

Because this problem isn't limited to profile2 I'm going to mark this as a bug in core.

cilefen’s picture

Title: Fatal error with proile2 because profile_type table not created. » Fatal error enabling profile2 because profile_type table not created.
Priority: Critical » Major
Issue tags: +Needs steps to reproduce

The issue is major because it is limited in scope, not a system-wide release blocker.

In order to call attention to the problem, the issue summary needs clear steps to reproduce.

cilefen’s picture

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.