Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm loving this module, but the options shown are listed as
I'm using a new install of Drupal 5.7, and using a view to populate the select list. I have had it working on an older version of my site (this is the 2nd time Ive done it!) but this doesn't seem to want to.
if I use the normal nodeselect list, which I feel is a little flimsy - it displays ok?!?
Also using teh Multirefernce CCK node does the same - but I don't really want to use that. This could point to the issue tho - something related to the 2 modules?!?
Any help is very much appreciated!
Comment | File | Size | Author |
---|---|---|---|
#24 | multiselect-filter_html-276091-24-d7.patch | 446 bytes | ntsekov |
#23 | multiselect-filter_html-276091-23-d7.patch | 439 bytes | ntsekov |
#18 | shows-html-code-276091-18.patch | 644 bytes | 5t4rdu5t |
#5 | screenshot-bug-multiselect.png | 10.61 KB | twistor |
Comments
Comment #1
l33103 CreditAttribution: l33103 commentedI'm loving this module, but the options shown are listed as a load of HTML, rather than regular text.
I'm using a new install of Drupal 5.7, and using a view to populate the select list. I have had it working on an older version of my site (this is the 2nd time Ive done it!) but this doesn't seem to want to.
if I use the normal nodeselect list, which I feel is a little flimsy - it displays ok?!?
Also using teh Multirefernce CCK node does the same - but I don't really want to use that. This could point to the issue tho - something related to the 2 modules?!?
Any help is very much appreciated!
Comment #2
attheshow CreditAttribution: attheshow commentedDear l33103,
Did you ever get your issue resolved? Have you tried the new Drupal 6 version of the module?
Comment #3
attheshow CreditAttribution: attheshow commentedComment #4
attheshow CreditAttribution: attheshow commentedNo response from poster after three weeks. Closing.
Comment #5
twistor CreditAttribution: twistor commentedI can confirm this, with multiselect-6.x-1.x-dev. It works fine for adding the node, but if you go to edit the node all of the items on the right have the tags:
whereas the correct ones only have the option tag:
If you move them back to the other side it stays the same way. Also, after saving the changes persist and look fine. I'm using this in a node reference view.
Comment #6
attheshow CreditAttribution: attheshow commentedWhat do you mean when you say you're using it "in a node reference view"? I ask because those span tags look to me like they might be coming from the Views module.
Comment #7
twistor CreditAttribution: twistor commentedMy mistake, it's actually a view of flagged users. I think the problem may be that the users are normally displayed as links.
Comment #8
attheshow CreditAttribution: attheshow commentedOk, I'm still unsure of how to duplicate what you're seeing. You'll have to describe how I can recreate your problem in a test environment.
Comment #9
emilymoi CreditAttribution: emilymoi commentedIf you setup multiselect to use a selection view, the view will embed html into each row, therefore causing multiselect to show the rows with html. The solution is to create a custom view fields template that just prints the row and no html.
Comment #10
attheshow CreditAttribution: attheshow commentedComment #11
mattgilbert CreditAttribution: mattgilbert commentedi'm using multiselect on a node reference field and a simple view with two fields, Node:Type and Node:Title. When I save the field, then go back to edit, the saved values appear as :
<span class="views-field-type">....</span>
(There are actually many span tags, one for each field in your view.)
I guess it's the html that the view is generating, but the span tags and everything are visible. Is there a setting in views that I'm missing that makes it work with multiselect?
To recreate, in CCK create a content type with a field of type "Node Reference" (must have Nodes Reference module activated), using the multiselect widget, and allow unlimited values. Create a view for the multiselect, and set the multiselect widget to use that view. Create a node with some other nodes selected in the multiselect. Save the node, then go back to edit it. For me, the "Selected Options:" list has tags for each option.
Comment #12
attheshow CreditAttribution: attheshow commentedThe solution to this problem is in comment #9 above. You need to tell your view to not add the span tags. Click on "theme information" when you're looking at your view for more information on this.
Comment #13
mattgilbert CreditAttribution: mattgilbert commentedThanks! I got thrown off because I was trying to override the fields instead of the row. Overriding the views templates for fields only effects the "Available Options" select list for me, not the "Selected Options" select list. Templating the row did work though, so thanks!
Comment #15
jonathan_hunt CreditAttribution: jonathan_hunt commentedI ran into this problem, also using a view to populate the select list. The view wraps the data in numerous tags, but it's a pain to have to theme the view just to make it work in multiselect.
My suggestion is to strip the tags in in the option widget rendering.
Comment #16
attheshow CreditAttribution: attheshow commentedGood point. I reviewed the CCK optionwidgets module code and it looks like they're running
html_entity_decode(strip_tags());
on their strings, so I added that as well. Seems to be working nicely. Just committed that change to the dev version.Comment #18
5t4rdu5t CreditAttribution: 5t4rdu5t commentedThis issue happens again on the 7.x dev version. I'm posting a patch here that fixes the problem by stripping html from the widget's options, so there's no need to create any views templates.
We have tested it and works well for us.
Comment #19
enzipher CreditAttribution: enzipher commentedHey,
I did not test the actual patch in comment #18, but the fix works.
Cheers,
Comment #20
botrisConfirming the bug and the solution in #18
Comment #21
alexweber CreditAttribution: alexweber commentedThanks!
Committed in 677b20b and, strangely enough, reverted in 6e8f944 as the function which cleans up output is already preset in the _multiselect_build_widget_code() function.
What this means is that the dev release and any subsequent official releases will be working fine as far as this issue goes.
Comment #23
ntsekov CreditAttribution: ntsekov commentedI have created a patch for 7.x-1.11 version.
Comment #24
ntsekov CreditAttribution: ntsekov commentedI thinks it is better if we change filtering in _multiselect_allowed_values_filter_html. I have created a patch which will render properly.