This use case has now come up twice with different clients of mine:

They are using autocomplete to select a node. They choose a node and would like to edit the title so that the link to the node is the edited text. Since nodereference only stores the node's nid this is not possible.

But, since the form allows you to edit the title the client assumes they can do this. Only after submitting does the validation code say the title does not match the nid.

The attached patch adds a title field so that altered titles are accepted, removes the validation, and adds an install update function (make sure to run update.php after applying the patch).

I cannot think of a reason not to do this. If this is not the preferred default behavior then my next proposal is to make altering the title a configurable option for the widget.

CommentFileSizeAuthor
nodereference-alter-title.patch4.75 KBjpsalter

Comments

moshe weitzman’s picture

I actually need this as well. Don't know what the committers think of such a feature.

jpsalter’s picture

From the CCK project page:

CCK 5.x is feature frozen. Issues in the 4.7.x to 5.x update functions will be given priority, since 4.7.x is no longer supported.

Doesn't seem likely to be supported. Maybe they'd reconsider if more people requested this feature?

ccshannon’s picture

I'm using the D6 version, but I, too, have a client who instinctively try to edit the headline in the text box for autocomplete nodereference field. They Save the node and get a validation error about the title not matching. This confuses them greatly.

What they really need/want is a Node edit popup form that allows the Node to be edited from within the referrer node.

So, now I'm trying to figure out how to make that happen.

choster’s picture

Version: 5.x-1.7 » 7.x-2.x-dev
Assigned: jpsalter » Unassigned
Status: Needs review » Active
hefox’s picture

ccshannon:
http://drupal.org/project/inline_references

In general the original topic, the way to do ialt title for node referene in 6.2 branch would make a new cck field (not through ui, through cck field creation code) that consist of a node reference and a title field.

Gabriel R.’s picture

I often need this for different clients. Would love to see it in nodereference itself instead of another module.

BTW, is the patch for D6?

fgm’s picture

Project: Content Construction Kit (CCK) » References
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: nodereference.module » Code

nodereference and userreference for Drupal 7.x are now maintained separately in the References module: moving issue over there.

fgm’s picture

Component: Code » Code: node_reference

Categorizing.

obrienmd’s picture

While I understand the idea (coming here from http://drupal.org/node/157545, where good_man says he has a patch for this), would a custom field type w/ ref and title, or some "multigroup" style solution (some options are in -dev for D7) not work better for this?

good_man’s picture

The initial patch is ready there http://drupal.org/node/157545#comment-3991340