Commit 7faf1b22 authored by Nathan Phillip Brink's avatar Nathan Phillip Brink
Browse files

Issue #1525784: Workaound Drupal.settings.content_lock.internal_urls being...

Issue #1525784: Workaound Drupal.settings.content_lock.internal_urls being array instead of string because of #1356170, breaking JavaScript for image fields.
parent f73c85ce
......@@ -309,6 +309,21 @@ function _content_lock_add_unload_js(&$form, $form_state) {
if ($settings['unload_js_message_enable']) {
$settings['unload_js_message'] = variable_get('content_lock_unload_js_message', 'If you proceed, ALL of your changes will be lost.');
}
/*
* Workaround for http://drupal.org/node/1525784 where this function
* is called multiple times when doing a file field AJAX upload and
* array_merge_recursive() is used instead of
* drupal_array_merge_deep_array() to construct the Drupal.settings
* value. Not calling drupal_add_js() multiple times deprives
* file_ajax_upload() of the ability to mess up here ;-).
*/
static $called;
if (!empty($called)) {
$called++;
return $form;
}
$called = 1;
drupal_add_js(array('content_lock' => $settings), 'setting');
return $form;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment