Hi,
Thanks for the great work on this module.
I use the following settings for matrix field in a content type.
Widget type : Table with headers and multiple rows
Number of values : Unlimited
Empty cells : - (since I'm not able to add an empty selection in one of the select type drop down)
Hide empty cells: Checked
SCENARIO: When you create the node, there are a couple of empty rows with "add another item" button. You fill them and save it. When you edit the node the third empty row appears which is fine. Leave the third row empty and save it. Edit it the node again, you see the third and fourth empty rows. Leave them empty and save it.
Extra empty rows keep adding in every edit.
Can somebody help with this?
Thanks,
Phantom
Comments
Comment #1
phantomvish commentedI forgot to mention : the display of the field is fine. The empty rows (with "-" in the select widget column) are not displayed in the node.
Thanks,
Phantom
Comment #2
develcuy commentedsubscribing
Comment #3
phantomvish commentedAm I the only one facing this issue? Any help would be appreciated.
Thanks
Phantom
Comment #4
cjeich commentedsubscribing
Comment #5
phantomvish commentedI'm still facing the issue, any help would be appreciated
Comment #6
tonylegrone commentedI'm having the same problem.
Comment #7
tonylegrone commentedI've narrowed this problem down to the select field I'm using. Unfortunately, there is no empty option for select fields so there is always a value being saved on the extra row.
My plan is to either fix the CCK select field behavior or stop the matrix module from displaying an extra row until the user clicks "Add another item"
Comment #8
tonylegrone commentedGOT IT!
It turns out that in a CCK select field, you can make the first option value <none>. I used "<none>|Please Choose".
This doesn't completely fix the problem though. In matrix.module you need to change line 335 to:
if (strlen(trim($val)) && $val !== '<none>') {This fixes the extra validation needed to filter out the <none> value for select fields.