Hello,

i use nodereferrer and nodereferrer_create modules for my site, and i'm thankful for the Add Another module because it seems to be just what i need to save my site from these mainly-unsupported modules without re-doing the whole site! However, i think i need some minor additional functionality to get it working for my purpose. (as a background, what nodereferrer/nodereferrer_create does is generates a reverse nodereference relationship of sorts, pre-populating a nodereference field upon node creation)

when i create a new node with nodereferrer create, it uses this url pattern:

/node/123/create_referrer/0/nodetype/0 instead of /node/add/nodetype

"123" changes depending on the node id of the parent/referenced node
"nodetype" changes depending on the new node type i want to create
"node","create_referrer",and the "0"s stay the same... i honestly have no idea what the 0s are for

so, i see this code in the module:

$_addanother_message = t('Add another %type.', array(
'@typeurl' => url('node/add/'. str_replace('_', '-', $node->type)),
'%type' => node_get_types('name', $node)
));

...where it appears that the url is shown: url('node/add/'. str_replace('_','-',$node->type))

---------------

so, what im asking is that if you dont want to change the module to allow for custom/tokenized urls like i need, would you please help me figure out how to alter the existing code for my own purposes?

i would need to change that url to node/*nodereference field node id*/create_referrer/0/nodetype/0

ideally i could somehow allow for different "nodetype"s, for a few different node types i have
also, the "*nodereference field node id*" would be a field that was present on the node you want to "add another" of (and contains the value of the node you are wanting to create another reference to):

create type A (make, of a car, such as "Ford")
nodereferrer_create lets you make a type B which is a "child" of type A (model, of a car, such as "Mustang")
when you create the "Mustang" type B node with nodereferrer_create, it auto-populates a nodereference field to "Ford" (its parent)

so, when you "add another" you would have to somehow preserve the node id of the nodereference in the "Mustang" node ("Ford", node id 123) and by adding it to the url you redirect to when you want to "add another", that would populate the nodereference field on the new node

i totally understand if you don't know what i'm talking about and just say "not going to implement" and close this. i would, however, be willing to pay a small amount of money to get this feature somehow. you hardly have any issues in your queue ;)

thanks for your time,
Bill

Comments

c-c-m’s picture

Since I have a similar problem, I will add my comment here (although due to my lack of knowledge I'm not pretty shure if they are the same, so forgive me if I'm wrong).

I am also using referenced nodes but I'm using node-reference url, so the pattern I use is the following:
/node/add/referenced-node-type/referrer-node-id?destination=node%2Freferrer-node-id

It would be great that "Add another" could have some way to do something like this, since it would save a lot of time to all the users who have to add referenced nodes.

Hope you can take this into consideration.

Regards

robin monks’s picture

Version: 6.x-1.3 » 7.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)

If someone is able to provide links to stable Drupal 7 versions of these modules and provide examples of the types of URLs addanother should be creating to deal with them I will do my best to add compatibility. As it stands now however, there are no stable versions of these modules that I could find in mass use.

/Robin

rogical’s picture

+1

In D7, those modules are:
http://drupal.org/project/references
http://drupal.org/project/nodereference_url

the node reference url module depends on the url arguments, as well as some other modules (I may custom my own).

So, I think it's import to reserve the original url structure of node add form.

mlncn’s picture

Status: Postponed (maintainer needs more info) » Active

Stable releases came in May it looks like, marking active. Will probably need this for a project in progress but don't have specific examples yet.

robin monks’s picture

Looking into this locally; it's a bit like peeling an onion. Patches from others (especially those more familiar with references) are welcome, otherwise I'll keeping trying to peel off another layer.

/Robin

robin monks’s picture

Status: Active » Fixed

This now works as expected on 7.x-2.x-dev; and likely opens up interoperability with other modules as well. I might consider making a hook_addanother_path to allow modules to tinker with the paths created -- not sure of the need for such a feature yet, tho.

/Robin

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.