diff -u b/editablefields.module b/editablefields.module --- b/editablefields.module +++ b/editablefields.module @@ -6,7 +6,7 @@ */ /** - * Implementation of hook_field_formatter_info(). + * Implements hook_field_formatter_info(). */ function editablefields_field_formatter_info() { $all_types = array_keys(field_info_field_types()); @@ -42,7 +42,8 @@ 'dependencies' => array( array('system', 'drupal.form'), // editablefields.js contains a small override to the autocomplete code. - // as a consequence, we need to load the autocomplete code unconditionnally. + // as a consequence, we need to load + // the autocomplete code unconditionnally. array('system', 'drupal.autocomplete'), ), ); @@ -51,7 +52,7 @@ } /** - * Implements hook_permission() + * Implements hook_permission(). */ function editablefields_permission() { return array( @@ -170,7 +171,6 @@ */ function editablefields_field_ui_display_overview_multistep_submit($form, &$form_state) { $trigger = $form_state['triggering_element']; - $op = $trigger['#op']; // Store the saved settings. $field_name = $trigger['#field_name']; @@ -231,8 +231,7 @@ return; } - $field_name = $field['field_name']; - list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + list($id, $vid,) = entity_extract_ids($entity_type, $entity); // See if access to this form element is restricted, // if so, skip widget processing and just set the value. @@ -242,8 +241,8 @@ } if (isset($display['views_view'])) { - // Views integration mode: we need to pass the unrendered form to the handler. - + // Views integration mode: we need to pass + // the unrendered form to the handler. // Remove the View data from the display, we don't need to save it. $view = $display['views_view']; $views_field = $display['views_field']; @@ -255,7 +254,8 @@ // Set our form callback. $views_field->views_form_callback = 'editablefields_views_form'; - // Load the original (unrendered) entity from the cache of the Field API views handler. + // Load the original (unrendered) entity from the cache of + // the Field API views handler. $entity = $view->result[$row_id]->_field_data[$views_field->field_alias]['entity']; // Save our data. @@ -270,7 +270,8 @@ } // Search for the field object in the $view->field array, so as to extract - // its actual ID. Views doesn't provide any reliable way to do that otherwise. + // its actual ID. Views doesn't provide any reliable + // way to do that otherwise. $field_id = array_search($views_field, $view->field, TRUE); $items = array(0 => array()); @@ -306,9 +307,8 @@ * Form builder callback. */ function editablefields_form($form, &$form_state, $entity_type, $entity, $field, $instance, $langcode, $display) { - // TODO: set a #action to a "safe" URL so that forms embedded in Views do not + // @todo set a #action to a "safe" URL so that forms embedded in Views do not // break when the result set displayed in the Views changes. - // Set #parents to 'top-level' by default. $form += array('#parents' => array()); @@ -388,13 +388,13 @@ $items = isset($items[$langcode]) ? $items[$langcode] : array(); $shield = new EditableFieldsShield(); $shield->arguments = array( - $entity_type, - $entity, - $field, - $instance, - $langcode, - $items, - $display + $entity_type, + $entity, + $field, + $instance, + $langcode, + $items, + $display, ); $form['field'] = array( @@ -439,7 +439,9 @@ } /** - * Pre-render function: render the fallback formatter of a field, but only if it is actually displayed. + * Pre-render function. + * + * Render the fallback formatter of field, but only if it's actually displayed. */ function editablefields_lazy_render_fields($element) { $element['field'] = call_user_func_array('editablefields_fallback_formatter', $element['#arguments']->arguments); only in patch2: unchanged: --- a/editablefields.js +++ b/editablefields.js @@ -1,7 +1,7 @@ (function ($) { Drupal.behaviors.editablefields_submit = { attach: function (context) { - $('.editablefield-item', context).once('editablefield', function() { + $('.editablefield-item', context).once('editablefield', function () { var $this = $(this); // There is only one editable field in that form, we can hide the submit