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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rvilar’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

Nowadays, 2.x branch is not usable. Please, use 1.x branch for development purposes.

emorency’s picture

Status: Active » Needs review
FileSize
4.19 KB

Ok, that's a start.

emorency’s picture

There is a bug when installing the module... I'll look into it next week.

Jeffrey C.’s picture

acouch’s picture

Status: Needs review » Needs work

I 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.

acouch’s picture

Attached 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.

acouch’s picture

Status: Needs work » Needs review

Updating status.

Jeffrey C.’s picture

Default 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.