first option of cck select list not showing up

ipwa - July 1, 2008 - 16:34
Project:Better Select
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I really like this module, thanks for working on this. One problem that I'm having though is that it doesn't show the first option in select lists made with cck select list widget. This happened to me on views exposed filters, and also when editing the view. Hope this can be fixed, this is much needed in Drupal it improves usability a lot.

#1

chris_five - September 1, 2008 - 00:04

You didn't provide any details about the exact nature of the problem you're experiencing, but I suspect the views module is the culprit.

http://drupal.org/node/142347

The patch provided in comment #39 worked for me, although the thread identifies a fundamental flaw in views of which the aforementioned patch merely fixes a symptom thereof.

#2

HnLn - September 5, 2008 - 08:57

I have the same issue (not related to views). When I enable "better select" I get the problem when adding a cck date field: the granularity options normally show year, month, day, ... With better select the year option is not there anymore.

HnLn

#3

HnLn - September 5, 2008 - 09:29

Had a quick look at the code and it seems this is the problem:

if (!$element['#required']) {
array_shift($element['#options']);
}
(line 27-29 in betterselect.module)

I guess the if statement needs to be expanded and check if the first value of options is an empty value indeed.

Tnx,

HnLn

#4

HnLn - September 5, 2008 - 10:21

I fixed my local copy be modifying the code this way:

if (!$element['#required'] && !key($element['#options'])) {
array_shift($element['#options']);
}

(line 27-29 in betterselect.module)

HnLn

#5

setvik - September 6, 2008 - 03:28
Status:active» fixed

fix committed. should be available in dev release later today

#6

setvik - September 7, 2008 - 23:13
Status:fixed» active

whoops... not fixed yet

#7

setvik - September 7, 2008 - 23:45
Status:active» fixed

fixed in cvs. should be in dev release in half a day

#8

Anonymous (not verified) - September 21, 2008 - 23:52
Status:fixed» closed

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

#9

asak - October 1, 2008 - 20:07

If you STILL find yourself after trying this patch with an enpty labeled value at the top, it's probably because you used the same patch as i did (which I can't seem to find...) to change the "None" value into an <All> value.

if you look in the source, you will see a stupid <all _moz-userdefined=""/> where the label <All> should of been.

I had no idea where this text is comming from, so I just used the string overrides module to change it into [All] ...

Now all is well ;)

 
 

Drupal is a registered trademark of Dries Buytaert.