At this moment, features.ctools.inc contains this function:
function ctools_component_features_revert($component, $module = 'foo') {
$info = _ctools_features_get_info();
$objects = module_invoke($module, $info[$component]['default_hook']);
if (!empty($objects)) {
$schema = ctools_export_get_schema($component);
$export = $schema['export'];
$names = db_placeholders(array_keys($objects), $schema['fields'][$export['key']]['type']);
db_query("DELETE FROM {{$component}} WHERE {$export['key']} IN ({$names})", array_keys($objects));
}
}
But, recently, ctools allows to use joins in exports, and there is an issue to use this joins objects are removed from tables: see #853114: Delete objects from tables considering joins
I think this function should only call to ctools_export_crud_delete() instead to call to DELETE FROM directly.
Comments
Comment #1
yhahn commentedI agree, I suppose we'll have to support both methods for a while with a check as this is a very recent addition to CTools Export API?
Comment #2
dagmarYes, those functions were included few weeks ago, and are available in the last development version of ctools. (Ctools API 1.7)
Here is the patch.
Comment #3
damienmckennaIf developers are going to update to the newest Features release to get this improvement then I don't think it's too unfair to increase the CTools dependency to the latest v6.x-1.7 release (never mind the other great improvements in that release of CTools).
Comment #4
dagmarAnyway it isn't working properly, I will provide a new patch soon.
Comment #5
yhahn commentedHere is a rerolled patch, it gets a bit simpler from some of the features refactoring.
It's working for me locally with non-join based exportables, would love some review from someone using (and familiar with) joins in export.inc.
Comment #6
yhahn commentedCommitted here http://drupalcode.org/viewvc/drupal/contributions/modules/features/inclu...