When the modules uuid_features and current_search (a contrib of the Facet API module) are both activated, I receive the following error, when I attempt to re-create any feature:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd7db.block_current_search' doesn't exist: SELECT b.delta AS delta, b.searcher AS searcher FROM {block_current_search} b; Array ( ) in uuid_current_search_configuration_features_export_options() (line 16 of /var/www/html/sites/all/modules/contrib/uuid_features/includes/uuid_current_search_configuration.features.inc).
The website encountered an unexpected error. Please try again later.

The table block_current_search doesn't appear to exist or be created by the current_search (or any) module.

I've been able to keep working by removing the SQL call made at the line 16 listed above, but I don't believe this is an adequate solution. The options this module is looking to export thru this call may exist somewhere else. It's also possible this should be cross-posted to the Facet API issue queue.

I have been able to verify this with UUID Features 7.x-1.x-dev, as well as 7.x-1.5 and 7.x-1.x-dev of Facet API.

Comments

jmdeleon created an issue. See original summary.

jmdeleon’s picture

Issue summary: View changes
jmdeleon’s picture

StatusFileSize
new772 bytes

Rolled a patch for this issue.

das-peter’s picture

Status: Active » Needs work
  1. +++ b/includes/uuid_current_search_configuration.features.inc
    @@ -10,12 +10,7 @@
    -  $current_search_items = db_select('block_current_search', 'b')
    -    ->fields('b', array('delta', 'searcher'))
    

    I can imagine that this was / is version specific. So why not checking if the table exists (https://api.drupal.org/api/drupal/includes%21database%21database.inc/fun...)? And only run the query if it does.

  2. +++ b/includes/uuid_current_search_configuration.features.inc
    @@ -10,12 +10,7 @@
    +  $current_search_items = array();
       foreach ($current_search_items as $config) {
    

    So if we now set the variable to an empty array why should we still have coder iterating over it?

jmdeleon’s picture

das-peter: Thanks for the suggestions. I have attempted rolling a less-destructive patch, attached here.

jmdeleon’s picture

Status: Needs work » Needs review

  • das-peter committed 9aaed6d on 7.x-1.x authored by jmdeleon
    Issue #2966601 by jmdeleon: Feature recreate crashes with error when...
das-peter’s picture

Status: Needs review » Fixed

Thanks for the patch! Committed & pushed.

Status: Fixed » Closed (fixed)

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