My problem is that I have 2 features that are exporting default contents. Feature_1 exports some default pages (about and homepage) and Feature_2 creates some demo content for my website. I don't want to merge the 2 features because you can select what type of installation you want through an installation profile, either you install a fresh install (only Feature_1 is enabled) or you install a demo website (Feature_1 AND Feature_2 are enabled).
Because the nodes are not sorted, I cannot rely on the fact that nodes from the Feature_1 will be created before nodes from Feature_2 and I cannot be sure that, for example the about page will always have an id of 1.
To solve that issue I intend to implement the method node_import_sort and modify the form where we specify the machine name to be able to optionaly specify a sort parameter...
Basically, I will be able to order specific nodes by asisgning them a value of 1,2,3... I'll be attaching the patch in a few hours.
- Etienne
Comment | File | Size | Author |
---|---|---|---|
#6 | node_sort_value-1436094-6.patch | 4.87 KB | acouch |
#6 | INTERDIFF.txt | 1.13 KB | acouch |
#2 | node_sort_value-1436094-3.patch | 4.19 KB | emorency |
Comments
Comment #1
rvilarNowadays, 2.x branch is not usable. Please, use 1.x branch for development purposes.
Comment #2
emorency CreditAttribution: emorency commentedOk, that's a start.
Comment #3
emorency CreditAttribution: emorency commentedThere is a bug when installing the module... I'll look into it next week.
Comment #4
Jeffrey C. CreditAttribution: Jeffrey C. commented@emorency: Possibly #1446714: Fatal error: Call to undefined function context_get_plugin() in modules/defaultcontent/defaultcontent.module. Can anyone confirm #2 is a working patch?
Comment #5
acouch CreditAttribution: acouch commentedI can confirm this works but the sort value is the opposite I would think you would want. Highest number goes first instead of lowest. I don't have time to fix that right now.
Comment #6
acouch CreditAttribution: acouch commentedAttached is a patch against the recent dev that gets the sort value correct. I changed 'defaultcontent_import_sort' to sort by the new sort_value instead of by the hooks for the different import types since the sort_value should override those. This module is still a mess but this works for me for now.
Comment #7
acouch CreditAttribution: acouch commentedUpdating status.
Comment #8
Jeffrey C. CreditAttribution: Jeffrey C. commentedDefault Content has been deprecated in favor of UUID Features Integration. Nothing will be committed unless there is a working patch and does not affect current functionality much.