I was building up a View recently and noticed that the very helpful "Convert to lower" options were gone when dealing with CCK Text select lists (they still work fine for textfields strangely). When poking through the Views documentation I found this helpful comment in the Views docs (in views_handler_argument_many_to_onc.inc):

 * - numeric: If true, the field will be considered numeric. Probably should
 *   always be set TRUE as views_handler_argument_string has many to one
 *   capabilities.

So basically we've been using the wrong handler for text. Since we've switched to using the many_to_one handler we've lost all the nice options that the text handler gives us, yet it turns out the text handler had many to one support built into it directly!

Take a look at the attached screenshots of the many-to-one, text-only, and text-many-to-one-enabled. Seems like this enhancement would be a winner for everyone.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

webchick’s picture

Subscribe.

KarenS’s picture

The issue is that the handlers that were available kept changing as Views evolved. We had CCK using Views way back before many of these handlers existed. We made some changes later as better options became available, but the last time we swapped out a handler for another better one we had to deal with lots of angry people whose views were broken by the change.

I'm not sure what the best solution is, but we can't do it the way we did last time (just swapping in a new handler), we probably have to keep the existing one and provide an additional option that people can selectively use. I'm not 100% if this patch is going to cause the same problems that we had before, but I assume it will.

emsbrooklyn’s picture

Is there a solution to this issue? Really need the "Transform" and "Case" options for my Views to work with "select lists". I've got two CCK fields with 'select lists' for 1) Regions (Africa, South America, etc.) and 2) Countries (France, Hong Kong, United States, etc.) and need to pass them as Arguments in Views and need to transform spaces to dashes (and make lowercase).

I can't have users typing info into Region and Country fields because it's critical info.

Thanks,
Eric

m4olivei’s picture

KarenS,

Any idea what issues came up the last time something like this was attempted? Were the issues specific to the values some people had for their Text select lists, or was it something more fundamental? I'm considering using this patch and I'm thinking (hopping) maybe it could be safe if the issues are around specific text values used with this feature, and my particular circumstance doesn't hit those cases.

Thanks,
~Matt

m4olivei’s picture

I've applied the patch without issue and all is working well.

Thanks,
~Matt

toomanypets’s picture

This patch solved a key problem for me: how to use "some-text" at the end of a URL as a Views argument instead of "Some Text". The argument is one of several values in a CCK select list. It would be nice if this patch were included with the next CCK update (presuming it doesn't break anything else). Currently using 6.x-3.x-dev.

ratinakage’s picture

Is this patch for cck 2.x or 3.x or both?

I hit the same issue as everyone else in this thread. I definitely think it should become part of the module (so long as it doesn't break anything of course...)

Thanks!

ratinakage’s picture

Version: 6.x-2.1 » 6.x-2.8

Hmmmm.

OK, I installed the patch but I don't see the change when I am configuring my View. Are there any additional steps?

I'm on the latest Views 2.8.

Thanks!

KarenS’s picture

Please read comment #2. We cannot just swap this in. We might be able to add an additional handler option. The problem is if we change the default value suddenly hundreds of thousands of sites have a new handler that may or may not be set up right or do what they want.

KarenS’s picture

Status: Needs review » Needs work
mgriego’s picture

Issue summary: View changes

We've run into this ourselves recently. What will it take for this to get closed out? Can we assume a certain level of Views at this point? Or would it be sufficient to update the patch to check the Views version (or some other similar check) to see if the 'many to one' option is available and use it if so, otherwise fall back to replacing the handler?