"Edit" button is processed twice with AJAX.
As it is rendered with 'ctools-use-modal' and 'use-ajax' classes it is processed both with CTools Modal and native Drupal AJAX.
In my case it leads to CKEditor inside the modal throwing an exception and data from all the instances is not being saved.
As far as I understand, 'use-ajax' class should be removed.
$element['edit'] = array(
'#type' => 'link',
'#href' => 'media/' . $fid . '/edit/nojs',
'#title' => t('Edit'),
'#attributes' => array(
'class' => array(
// Required for CTools modal to work.
'ctools-use-modal', 'use-ajax',
'ctools-modal-media-file-edit', 'button', 'edit',
),
),
'#weight' => 20,
'#access' => $element['#file'] ? file_entity_access('update', $element['#file']) : FALSE,
);
Comment | File | Size | Author |
---|---|---|---|
#3 | removed-extra-class-2565819-3.patch | 441 bytes | eyeless |
Comments
Comment #2
eyeless CreditAttribution: eyeless commentedComment #3
eyeless CreditAttribution: eyeless at EPAM Systems for NBCUniversal commentedRemoved extra class.
Comment #5
apanag CreditAttribution: apanag commentedHave tested it for a while now and works great.
Thank you!
Comment #6
dmsmidtHelps a lot! I couldn't close the modal without it.
Comment #7
heddnClosed #2463663: Ajax requests duplicate is a duplicate. It had the same exact patch, so another +1 on RTBC.
Comment #9
Dave ReidCommitted #3 to 7.x-2.x.