Needs review
Project:
Data
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2012 at 22:19 UTC
Updated:
17 Dec 2018 at 10:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
scor commentedHere are a couple of manual work arounds.
1. via the UI, you can enable data_ui and schema modules, and hit the "create table button" in the compare schema tab at
admin/structure/data/compare/YOURTABLENAME2. I managed to do it progammatically as well via two separate update functions (for deployment):
Comment #2
joachim commentedTricky to fix, as you'd need to know when a Feature is enabled and quickly whip in and make the data table it describes.
Features has a hook_features_enable() which might be the place to do that in.
Comment #3
mstef commentedWould it make sense to implement hook_modules_installed() (http://api.drupal.org/api/drupal/modules%21system%21system.api.php/funct...) in data.module? See if the module being installed contains a data table export, and create them?
Comment #4
joachim commentedJust spotted this in the api.php file:
I assume this is how features define their tables?
Is it possible to force a feature to add a code function to take care of installing the tables>
Comment #5
andybrace commentedI'm also seeing this when enabling a feature containing a data table definition, the table is correctly defined but is not imported when the feature is enabled. hook_ctools_plugin_api has been correctly defined and the hook_data_default definition is also found in the module.data_default.inc file as expected. When viewing the feature in the admin ui screen it is showing as state 'default' so there is no option to revert the feature.
Has anyone else managed to find a solution?
Comment #6
ice5nake commentedI am also seeing this in the 6.x version. I guess Features support isn't fully baked out yet?
As an aside, surprisingly Feeds does not complain about the data table not being there when I import into it. It acts like it succeeds but obviously nothing is actually imported into the table.
Comment #7
zeip commentedAttached is a patch for Features integration. It uses the Ctools export but provides the Features export & import as custom functionality. It seems that tapping into the Ctools Features revert doesn't work very well, so this seems to be the way to go.
Comment #8
brtamas commentedHi, I have updated the preivous patch to work with 7-1.0-alpha7 release.
Comment #9
caschbre commentedPatch #8 seems to work for alpha8 as well. One thing to note is that it only works with tables exported using the patch. Previously exported tables using just the alpha8 release would not properly import.
Comment #10
caschbre commentedI take that back... I'm unable to export the tables. Nothing appears to be generated.
Comment #11
johnorourke commentedFor anyone arriving here looking for a way to define your schema in just one place, and have tables automatically created, *and* available as entities and views via the data module, here's how I did it without using any patches, in 7.x. In this case you don't need to add the tables to your feature module since they're defined in our custom module:
mymodule.module: