Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Cart
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2010 at 04:19 UTC
Updated:
5 Jan 2011 at 05:30 UTC
The following error happen when removing an item from the cart. I'm running latest core, entity and other conntributed modules.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.field_config_entity_type' doesn't exist: SELECT * FROM {field_data_line_items} AS fd LEFT JOIN {field_config_entity_type} AS fc ON fd.etid = fc.etid WHERE line_items_line_item_id = :line_item_id; Array ( [:line_item_id] => 2 ) in commerce_line_item_commerce_line_item_delete() (line 246 of /somepath/commerce/modules/line_item/commerce_line_item.module).
Comments
Comment #1
rszrama commentedAhh, yeah, that one. It's from commerce_line_item_commerce_line_item_delete(), a function that executes a query against a table that no longer exists in RC 2 (it got taken out in a recent API changing patch... really, they always think no one's using these APIs : P). In any event, that code itself can probably be replaced with EntityFieldQuery anyways.
The quick fix would likely be to just remove the JOIN as I think it's no longer necessary.
Comment #2
rszrama commentedSo, apparently this code is deprecated. In testing, I discovered that the supposed functionality the hook implemented was occurring without the hook. In other words, as the line item is deleted from the cart, line item reference fields referencing the line item were getting their values updated automatically to remove the deleted line item. Amazing... I honestly don't know when this started happening.
Commit to remove the hook implementation altogether:
https://github.com/rszrama/drupalcommerce/commit/b340c68415c452e9ad412ef...
Comment #3
recidive commentedGood catch! Thanks for fixing!