I added a CCK select field to a Profile using the core Profile module. If I look at the list when editing a Profile everything is fine, but if I use the list as a Filter in a View, commas break the lines.
In Profile:
Denver, CO
In Views:
Denver
CO
I found a discussion about this when they fixed it in the Profile module. http://drupal.org/node/89459
They turned this:
...
case 'selection':
$options = $field->required ? array() : array('--');
$lines = split(",[\n\r]", $field->options);
foreach ($lines as $line) {
if ($line = trim($line)) {
$options[$line] = $line;
}
}
...
...into...
...
// line 662 - 668
case 'selection':
$options = $field->required ? array() : array('--');
$lines = split("[\n\r]", $field->options);
foreach ($lines as $line) {
if ($line = trim($line)) {
$options[$line] = $line;
}
}
...
...by removing the ',' that split the line.
Any way to stop commas from breaking lines in Views select lists chosen as Filters? Thanks.
Comments
Comment #1
dawehnerthis exact same code is placed in views
here is the patch which does the same as your previous patch, just removes the ","
Comment #2
gettysburger commentedAwesome. Many thanks!
Comment #3
bverc commentedI also had this problem and aaplied this patch, how can I update my current views to redo the filters?
Comment #4
bverc commentedThis is still an issue. If it is such a simple fix, why hasn't it made it into the views code yet?
Comment #5
merlinofchaos commentedIn part because this issue is not set to the 'needs review' status so it didn't show up when I was looking for patches.
Comment #6
merlinofchaos commentedCommitted.
Comment #8
gettysburger commentedI upgraded to Views 2.x-dev and am still having this problem. I have emptied my cache a million times and have tried making a new view, but when I have a comma in an item in a select list in Profile, it breaks the line.
I even tried removing the comma in the profile.module file.
Any thoughts? Thanks.
Comment #9
dawehnerThis is my views_handler_field_profile_list.inc
Comment #10
jbrauer commentedIt looks as though this patch slipped through and didn't actually get applied as intended in July.
Comment #11
merlinofchaos commentedInteresting.
Here's the one I have:
Comment #12
merlinofchaos commentedDoublechecked everything. This is really in, though it's not in any released code. Only 2.x and 3.x dev.
Comment #13
JacobSingh commentedIs this the twilight zone of CVS? :)
http://drupalcode.org/viewvc/drupal/contributions/modules/views/modules/...
Doesn't look like it ever made it into DRUPAL-6--2, isn't that what was meant by "Only 2.x and 3.x dev" ?
Comment #14
JacobSingh commentedOkay, never mind, the commit did go in July, not September it seems. The code looks right.
Comment #15
dawehnerThis bug will be reappear thanks to http://drupal.org/node/675264#comment-2752976
But its no really a bug, its by design of the profile module.