Commit ab173936 authored by fgiasson's avatar fgiasson
Browse files

Fix an issue with Drupal 7.39 which introduced a new way to use Autocomplete...

Fix an issue with Drupal 7.39 which introduced a new way to use Autocomplete fields. That was causing that the entities couldn't be synchronized anymore if you upgraded to Drupal 7.39
parent eed59993
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1940,6 +1940,7 @@ function osf_entities_sync_structure_classes_validate($form, &$form_state) {
function osf_entities_form_osf_entities_sync_structure_classes_alter(&$form, &$form_state, $form_id)
{
  $form['used_classes']['uclasses']['#process'][] = 'osf_entities_disable_element';
  $form['used_classes']['uclasses']['#process'][] = 'form_process_autocomplete';
  
  if(isset($form['#attached']['css']))
  {
@@ -1964,6 +1965,7 @@ function osf_entities_form_osf_entities_sync_structure_properties_alter(&$form,
        if(strpos($key2, 'used_properties_') !== FALSE && strpos($key2, 'unused_properties_') === FALSE)
        {
          $form[$key][$key2]['#process'][] = 'osf_entities_disable_element';
          $form[$key][$key2]['#process'][] = 'form_process_autocomplete';
        }
      }
    }
@@ -2343,6 +2345,7 @@ function osf_entities_sync_structure_properties($form, &$form_state)
        '#default_value' => $default_value,
        '#autocomplete_path' => 'osf/entities/get/properties/'.$bundle,
        '#name' => $bundle.'_'.$i,
        '#id' => $bundle.'_'.$i,
        '#attributes' => array(
          'id' => $bundle.'_'.$i,
          // Fix the size of the input to make sure the throbber is properly displayed