Hi,

I get this error when I try to add comment index: https://www.drupal.org/files/issues/error_204.png
This issue appears if there are no nodes. So, $bundles variable is empty and as a result, this condition:

$query->condition($bundle_column, $bundles);

causes an error.

I also think, that it can cause other issue as well. In order to prevent this, we should add a check.

I've attached a patch for review.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alan-ps created an issue. See original summary.

alan-ps’s picture

Issue summary: View changes
michel.settembrino’s picture

Priority: Normal » Major

I don't know if it is related to this issue but yesterday I applied the latest update (7.x-1.18 when I was running on 7.x-1.17) and due to this I can't update or create content.
I am getting this error: "PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'item_id' cannot be null: INSERT INTO {search_api_et_item} (item_id, index_id, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 17 [:db_insert_placeholder_2] => 1 ) in SearchApiAbstractDataSourceController->trackItemInsert() (regel 617 van search_api/includes/datasource.inc)."

Reverting to version 7.x-1.17 solved my issue.

alan-ps’s picture

Issue summary: View changes
FileSize
55.22 KB

Sorry, forgot about the screenshot. I have uploaded an image with my error.

drunken monkey’s picture

Priority: Major » Normal

Thanks a lot for spotting this! Your patch looks also great, thanks again!
I've spotted two more problems with the code in that method, we should fix them too since we're already at it. Patch attached.

@ michel.settembrino: That sounds like an entirely different problem, and moreover not like one connected to the 1.17->1.18 upgrade. Did you maybe also upgrade some other modules at the same time?

drunken monkey’s picture

drunken monkey’s picture

Status: Needs review » Fixed

Since no-one complained: committed.
Thanks again, everyone!

michel.settembrino’s picture

@drunken monkey,

This problem has been solved by upgrading the module search_api_et. I was running version 7.x-2.0-alpha1.
I had no issue but when I upgraded the module search_api I got this issue. So the upgrade of search_api_et was required.

But now I am getting some memory issues. My colleagues are investigating this new issue.

Best regards,
Michel.

Status: Fixed » Closed (fixed)

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