I have a link field that has an unlimited number of items. The remove button isn't showing up for that field.

CommentFileSizeAuthor
#3 linkfield.png25.94 KBcreeksideplayers

Comments

creeksideplayers’s picture

Category: Feature request » Bug report

Changing this to a bug. I looked at the module code, and it looks like link should be supported

sprocketman’s picture

I'm curious why this module tries to specify individual field widget types rather than just specifying any field that is multi-value. In particular, in multiple_fields_remove_button_field_widget_form_alter() it seems like you could simply remove the $fieldwidgets array and change the following if clause to

if ($context['field']['cardinality'] == FIELD_CARDINALITY_UNLIMITED && empty($form_state['programmed'])) {
...
}

This is exactly what the field module does for adding new items. Is there any reason why the same couldn't apply to the remove buttons. It seems like that would solve most of the issues in this module's queue.

creeksideplayers’s picture

StatusFileSize
new25.94 KB

I tried #2, and the remove button still isn't showing up. I added a "print 'I got here!';" inside the braces of the if statement, and that message showed up, but no remove button. I don't know if this has anything to do with it, but the link field has a title and a URL and is inside a fieldset.

asghar’s picture

Actually problem is with link module and does not allow to alter attributes and add new attributes in form links field.

jenlampton’s picture

Status: Active » Closed (works as designed)

@asghar is correct, this is a problem with Link module. Apply this patch to get everything working again: https://www.drupal.org/node/1980736#comment-7348806

creeksideplayers’s picture

I updated to the latest dev version of the link module, and now the remove button is showing up. Thanks jenlampton