Closed (fixed)
Project:
Relation Select
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2012 at 08:44 UTC
Updated:
28 Jan 2013 at 23:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
manicato commentedThe problem is that the ID of the submit button is not unique for the field.
My Situation:
Relation Field A
- Item 1 has #edit-submit--1 as ID
- Item 2 has #edit-submit--2 as ID
Relation Field B
- Item 1 has #edit-submit--3 as ID
Relation Field A: Now I add an item by clicking on "Add another item"
> Item 3 has #edit-submit--3 as ID which now is the same as the Item 1 of Relation Field B
The ID of the buttons generated should contain the name of the field.
Does anybody have an idea how to do this?
Comment #2
manicato commentedOK, I found the solution myself:
$form['#after_build'] = array('relation_select_exposed_form_after_build');
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
+ '#id' => 'edit-submit-'.$element['#id'],
'#ajax' => array(
'path' => 'relation-select/ajax'
)
);
Can anyone please create a patch for this?
Comment #3
manicato commentedHere's the patch
Comment #4
manicato commentedComment #5
chrisfromredfinHey there - just tested this patch on a relation select I have (only one relation field on this node type) that was set to unlimited. Patch solves problem in that case.
Comment #6
steveoliver commentedThanks, manicato for the patch, and cwells for the testing. Committed to 7.x-1.x in 2195403.
Comment #7.0
(not verified) commentedFurther information