Closed (fixed)
Project:
Entity Construction Kit (ECK)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2011 at 15:58 UTC
Updated:
12 Mar 2012 at 22:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
wjaspers commentedNOTES:
* Uses
features_var_exportinstead of attempting to hard-code exportable information.* Bundle support doesn't export any data yet, but the features UI is able to access them
* Entity Type support exports the exact information from
entity_get_info($entity_type). This likely needs to be tuned/updated.Comment #2
wjaspers commentedComment #3
fmizzell commentedAwesome, I have not reviewed the patch yet, but features support is definitely one of the major priorities for this project. Are you planning to do some more work on this? If you are, maybe a git branch should be created to work on this until it is complete. Thanks.
Comment #4
wjaspers commentedI definitely plan on working on it. I don't remember, can I fork a drupal git repo and operate on it myself, then push up?
Comment #5
fmizzell commentedyou can clone (fork) any repository, but you wont be able to push up unless I make you a co-maintainer. I am willing to do that so we can get this done. I will post back in here once I have created the branch with your patch changes, and had given you access to push stuff. I am in irc most of the time during US work hours, so maybe we can use that medium to coordinate efforts.
Comment #6
fmizzell commentedwjasper is currently working on it, and I will jump in when I get a chance, work is being done on the features branch of the repository
Comment #7
itangalo commentedTried the patch above, but got some serious problems from it. :-(
Drupal complained that lines 93 and 94 in eck.features.inc used undeclared indeces:
I tried commenting these out, just to see what would happen, and then Entity API became really upset:
Fatal error: Unsupported operand types in …/sites/all/modules/entity/includes/entity.property.inc on line 88(Line 88 says
$info['properties'] += $bundle_info['properties'];, so I should probably have set the properties and custom properties to an empty array rather than commenting the lines out.)I'll keep digging, and see what I can find. Maybe I can improve the patch somehow. Maybe this information is useful anyway.
Comment #8
itangalo commentedHuh. I tweaked entity.property.inc just to get the page execution going again, and now the eck_entity_type_features_rebuild function (with lines 93+94 in eck.features.inc) isn't called any more. Even when clearing cache.
I obviously need to learn more about how Features calls functions and rebuilds configuration. Things seem to kind of work now. I hope.
Comment #9
itangalo commentedHm. I tried enabling the Features export on a clean site, and I get the same errors as on the source site. When bypassing these by setings 'properties' and 'custom_properties' to empty arrays, I get database errors instead:
To investigate further, I ran entity_get_property_info() on my original site, and that tells me that is *has* some properties. My conclusion is that these properties aren't exported.
I stared at eck.features.inc for some time, but couldn't find where this should be added. Sorry. :-/
It *might* be relevant to know that I created an entity type with two bundles, and neither of the bundles have the same name as the entity type. (I don't think this affects the entity properties in any way, though.)
Comment #10
wjaspers commentedThanks for the heads up I left this hanging in my dev sandbox @italngalo. Assuming there's time this weekend, I'll try to keep at it.
Comment #11
itangalo commentedSorry, can't get this patch to apply (either to 2.x, master or feature branch). Now trying to apply the rejected changes, and hope to upload a re-roll.
Comment #12
itangalo commentedI managed to apply the patch! (I think.) It required applying the patch from #1 as well as #10, and I had to do a bit of extra magic since Git wouldn't accept the second patch.
Attached is a patch that applies against the 2.x branch as of today.
(Another comment with some analysis will come.)
Comment #13
itangalo commentedI did a test export, and it seems that the entity types now are exported just fine, but the bundles are left out.
The .info file says
features[eck_type][] = "test_bundle", but there is no inclusion file to define the bundle.I added a field to the bundle, and the bundle is named in the field export (which is probably no surprise).
The test export is attached in a feature.
Comment #14
wjaspers commentedI think the trick to bundles is to just export them like we do with content-types (nodes). All they really are are entity-types with N fields attached to them. (Where N is a number). I still have work to do on this.
Thanks for giving this a try.
Comment #15
itangalo commentedIt seems to me that the fields already have the information they need for being attached to the bundles – Strongarm picks up the relevant fields, and the field settings are all exported (including which bundle they apply for).
But maybe this was what you meant.
Anyways - thanks for great work. ECK is awesome, and I really look forward to be able to export custom entity types + bundles.
Comment #16
fmizzell commentedOk, I just pushed a couple of commits to the features branch. From very superficial testing both the export and import seem to be working after a little bit of clean up. After we get a little bit more testing done, we should be ready to merge this to 7.x-2.x. Thanks wjaspers and Itangalo for you work.
Comment #17
fmizzell commentedComment #18
fmizzell commentedI found a couple of bugs and they have been fixed, but I am not a regular features' user so I will wait until the real features' users give the go ahead for merging
Comment #19
fmizzell commentedI just noticed that half of the features branch was already merged with 7.x-2.x, so I decided to go ahead and merge the whole thing. Features should be working on 7.x-2.x
Comment #20
itangalo commentedJust tested the new and shiny 2.x-dev, and the Features export works just fine.
Thanks for great work!
(Marking this as fixed, since it is already committed.)