I've started to remove lot's of code in the 5.x-2.x branch and it's going quite well.
(Can't select version 5.x-2.x-dev in the issue-submission form, probably only after you make a release on that branch.)

The gui-functions are mostly gone (I've left the lonely-node stuff)

The automatic relations between nodetypes are gone.
I think I can also remove the remaining 4 nodefamily_ct_*() functions, but wanted to wait for you approval on that.

Also replaced several !is_null() with isset()

All that in the attached patch ;-)

CommentFileSizeAuthor
nodefamily-code-removal-1.patch8.02 KBray007

Comments

ray007’s picture

Status: Reviewed & tested by the community » Needs review

ups, wrong status

fago’s picture

Version: master » 5.x-2.x-dev
Status: Needs review » Fixed

thanks! -> committed.
I think you were not able to choose 2.x because there was no published release yet, now it has been created so you should also be able to choose 2.x :)

I don't know, if I've informed you about my population plans yet, so I do now.. :
nodefamily 1 has restricted the population of nodes per user, in nodefamily 2 I want to restrict the population of nodes per nodefamily.
So you could restrict how many children of a special type are allowed. This setting should be set through the API, when modules notify nodefamily about their relations. But as nodefamily doesn't create the relations, it can't do the checks any more, but still I think it's good to have this setting in the "central" place. However we should provide API functions, like nodefamily_relation_check_growth_access($parent_type, $child_type, $nid), which checks whether there are further children of this type allowed.

As an affect there are no lonely nodes any more. So we could remove all this code too, as well as the pageroute integration. (So nodeprofile 2.0 will have to care itself about lonely nodefamilies.. ;)

@nodefamily_ct_*_ functions:
No I want them to stay, but they need to be modified due to the relation name. I want nodefamily_ct_relation_add() or so take an array, which defines not only the related types, but also the relation name, the maximal population of each child type, the default values for children deletion, children display,.. So this should be the interface, which other modules use to tell nodefamily about their relations!

ray007’s picture

nodefamily 1 has restricted the population of nodes per user, in nodefamily 2 I want to restrict the population of nodes per nodefamily.
So you could restrict how many children of a special type are allowed. This setting should be set through the API, when modules notify nodefamily about their relations. But as nodefamily doesn't create the relations, it can't do the checks any more, but still I think it's good to have this setting in the "central" place. However we should provide API functions, like nodefamily_relation_check_growth_access($parent_type, $child_type, $nid), which checks whether there are further children of this type allowed.

I think we still should have the option for the maximum-per user, but probably give the relation another name. Should be rather easy to do.

As an affect there are no lonely nodes any more. So we could remove all this code too, as well as the pageroute integration. (So nodeprofile 2.0 will have to care itself about lonely nodefamilies.. ;)

I have no idea what the lonely nodes and pageroute integration are about, so I can't really comment on this one. If you can maybe enlighten me a bit here, maybe I can come up with something to do this another way?

fago’s picture

hm, give what relation another name?
ah yes Usernodes would be useful here. Then we could create another relation (yes another name, did you think of that?) which could be used with the existing children population limiting code.

That would be fine, however I don't like the dependency on the usernode module for this as nodeprofiles should work without it.

Another solution would be that we also support Node-User relations instead of using the usernode module for that. Perhaps that would be good idea, but that would need more thinking about it suits in the rest of the concept.

lonely nodes, are nodes of a type with a maximum population of 1, e.g. nodeprofiles. The nodefamily url handler does provide an add/edit page for each lonely node (type). As it is UI, I want to remove it. Furthermore pageroute does the same and more. Nodeprofile 2.0 will depend on pageroute, so there is no need for it any more. So feel free to remove it.
Furthermore the pageroute integration could be removed too, it just provides the add/edit pages for lonely nodes.
I'm planning a superior pageroute-nodefamily integration, which uses nodefamily to put all nodes created trough the same pageroute into a nodefamily - and also allows editing them through the same route. So it would support lonely nodes/nodefamilies, but also every other node(family).
pageroute issue: http://drupal.org/node/125213

Anonymous’s picture

Status: Fixed » Closed (fixed)