Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save junaidpv/dd71560d7e3ce380a952 to your computer and use it in GitHub Desktop.

Select an option

Save junaidpv/dd71560d7e3ce380a952 to your computer and use it in GitHub Desktop.
Patch for quickeditor module to make the CKEditor field format available at client side. So other modules like linkit can use it.
diff --git a/includes/pages.inc b/includes/pages.inc
index a8bac9b..764fcf0 100644
--- a/includes/pages.inc
+++ b/includes/pages.inc
@@ -387,6 +387,11 @@ function quickedit_ckeditor_get_untransformed_text($entity_type, $entity_id, $fi
if (_quickedit_is_extra_field($entity_type, $field_name)) {
$subform_id = quickedit_extra_field_info($entity_type, $field_name, 'quickedit subform id');
}
+
+ // Get field values to get the format for the field.
+ $field_values = field_get_items($entity_type, $entity, $field_name);
+ drupal_add_js(array('quickedit' => array('format' => $field_values[0]['format'])), 'setting');
+
$form_state = array(
'entity_type' => $entity_type,
'entity_id' => $entity_id,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment