firstly, great modules, have been asked for this by a number of clients . . .

The module does not seem to add the option to Node and User reference fields, only normal text fields.

Thanks,

Darrin.

And btw:
is this module being used by drupal.org for the drop down fields on this very input form, in the Project Information Version and Component fields ?

CommentFileSizeAuthor
#6 cck_required_reference_select.zip1.31 KBkndr

Comments

cwebster’s picture

Assigned: Unassigned » cwebster

Hi Darrin,

Good idea. When I have a moment, I'll see if it's possible to add that functionality.

As to your other comment, I'm not really sure how they're generating that value. Maybe there's something that I'm not aware of, or they just rolled their own code.

Darrin Southern’s picture

Thanks Chris.

Do you have a time frame as to when you can look at this ?
That way, I can be ready to test the code if you like . . .

Thanks again.

mgreen’s picture

I would find this very useful for a Node reference field as well.

mautumn’s picture

I thought this is what it did! :((

Node reference and user reference select lists are the most important for us. If you could find a way to achieve this that would be extremely useful for a great many people I'm sure. Why they were designed like that in the first place - automatically choosing the first one - beggars belief!

mautumn’s picture

Subscribing. We never use standard text select list, we always use node & user reference lists because they can be managed better i terms of permissions and ownership, roles, responsibilities, audit trail, etc. I would be great to have this very useful feature for these arguably much more important usecases...

kndr’s picture

StatusFileSize
new1.31 KB

I am using my own, attached here, mini module to fix this issue. Every required, single nodereference and userreference optionwidget select item is cheating during form building phase and this way, option '- Select one -' could be added at first position :) This is the only way, I found, withouth patching optionwidgets module. String '- Select one-' could be changed in theme function MYTHEME_optionwidgets_none($field) inside MYTHEME template.php. This is native theme function from optionwidgets module and I think should be used here. I hope, this mini module will be helpfull for maintainers and others.

kndr’s picture

Status: Active » Needs work
smithmilner’s picture

Thanks Kndr

looks like it's working!

roball’s picture

Priority: Normal » Major
Status: Needs work » Active

Any progress on this, cwebster?

cwebster’s picture

Thanks, kndr. Haven't had a spare moment to look into this. If anyone would like to be a co-maintainer, please let me know. I'll try to take a look over the weekend, if I"m able to.

cwebster’s picture

Status: Active » Closed (fixed)

It looks like this whole module may (thankfully) now be unnecessary. Please see http://drupal.org/node/849100.

I'm not sure it is a recent change that makes this functionality possible, but unless I'm notified of an unintended benefit of CCK Required Single Select, I'll soon discontinue it.

Thanks for all of the help!

roball’s picture

Status: Closed (fixed) » Active

But the suggested workaround does NOT work with Node and User references!

g.k’s picture

+1 same problem here with node reference

roball’s picture

Module from #6 works fine! It just needs to be integrated into this module somehow.

cwebster’s picture

@kndr: Had a moment to review your code. Seems to work! Can you explain this bit for me? (.module file, lines 41-53)

function phptemplate_optionwidgets_none($field) {
  switch ($field['widget']['type']) {
    case 'optionwidgets_buttons':
    case 'nodereference_buttons':
    case 'userreference_buttons':
      return t('N/A');
    case 'optionwidgets_select':
    case 'nodereference_select':
    case 'userreference_select':
      return t('- Select One -');
    default :
      return '';
  }

Usually I've seen "phptemplate" replaced with the module name. Is that not the case here?

Also, this seems like a completely separate module. Have you thought about becoming a contributor?

kndr’s picture

@cwebster
Thanks for review. Name of function "phptemplate_optionwidgets_none" is build according to instructions inside http://drupal.org/files/theme_flow_6_1.pdf. (hook is the function and override http://drupalcontrib.org/api/function/theme_optionwidgets_none/6). I don't know if name "modulename_hook" will work.
Yes, this seem like a separate module but I don't want to be a contributor. My English is poor. I suggest to incorporate this code inside your module since it does, what many users expect.

djween’s picture

same issue. subscribing.

nedwardss’s picture

Thank you for this mini-module. It was a huge help.

sinasalek’s picture

@kndr thanks for the module , works great

hanoii’s picture

MIght need this feature. Will review this module and the attached here and maybe see if I can contribute it to this module and have it all in one?

Not sure if this is needed but worth the try.

roball’s picture

kndr, your mudule works well and is still required to get this functionality, even when the "Required Single Select" module may not be required (however it is still useful). Could you please release it as an official module?

my-family’s picture

#6 Works nice, THANK YOU!!! +1 for an official module

kndr’s picture

Thank you very much for testing my #6 minimodule and so many feedbacks. I am happy I could help someone :) As I said at #16 i don't want to be a contributor of official module but if someone wants to be I have nothing against to use my code. Everyone is welcome :)

roball’s picture

Version: 6.x-1.0-beta2 » 6.x-1.0-beta3
Status: Active » Fixed

I have added the "CCK Required Reference Select" module to version 6.x-1.0 which has just been released.

kndr, Would you like to create a patch that integrates it into the main module, to be released in 6.x-2.0?

roball’s picture

Assigned: cwebster » roball

Status: Fixed » Closed (fixed)

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

roball’s picture

kndr, would you please like to comment at this issue's follow-up issue #1498200: Merge "CCK Required Reference Select" sub module into main module ? Thanks!