I made a patch to group items in a views select widget. Saw there was a comment about using the grouping data, and i had a use for it on my end, so here we are.

CommentFileSizeAuthor
nodereference.patch3.72 KBcorey.aufang

Comments

corey.aufang’s picture

btw, if this goes well, was planning on porting this to the updated userreference module as well

yched’s picture

Cool - does the autocomplete widget still work correctly with this ?

corey.aufang’s picture

Yeah, it still works. When I was first testing the autocomplete changes I had to made, I thought it was broken due to the "[nid:#]", but that is correct.

corey.aufang’s picture

just wondering if there was any more info on the status of this

corey.aufang’s picture

Assigned: corey.aufang » Unassigned
yched’s picture

Yes, sorry for not getting back at this.
Last time I tried, the patch did seem to play well for autocomplete widgets.
Also, I' really not sure of the best way to do this. If _nodereference_potential_references_views() returns a 'grouped' array, then it means _nodereference_potential_references_standard() has to return the same format, and all consumers of nodereference_allowed_values() have to deal with this new format. A feature in one use case (grouped views for noderef fields using the 'views' mode and the select list widget) affects the whole chain - tricky.
That's why I left this part as a later TODO when adapting the 'views mode' to Views2.

corey.aufang’s picture

Yeah, I didn't like what I had to do to so many functions to make it work correctly. If someone else doesn't come up with a more elegent solution, I'll revisit this when cck and views release. Thanks for the reply.