Skip to content

Instantly share code, notes, and snippets.

View junaidpv's full-sized avatar

Junaid P V junaidpv

View GitHub Profile
@junaidpv
junaidpv / patch_to_apply_patch_for_media.patch
Created August 21, 2015 11:54
Patch to apply patch to panopoly_widgets to apply patch to media module.
diff --git a/drupal-org-release.make b/drupal-org-release.make
index 55d99a4..550e2bb 100644
--- a/drupal-org-release.make
+++ b/drupal-org-release.make
@@ -17,6 +17,7 @@ projects[panopoly_magic][subdir] = panopoly
projects[panopoly_widgets][version] = 1.25
projects[panopoly_widgets][subdir] = panopoly
+projects[panopoly_widgets][patch][] = "https://gist.githubusercontent.com/junaidpv/548678046def41325c28/raw/d9ddcf904610ec794e765c7e0d0f552934eed3b8/apply_patch_to_media_wysiwyg.patch"
@junaidpv
junaidpv / consistent_media_folder_field_label.patch
Created August 25, 2015 07:59
To make field label same as fields filling step.
diff --git a/media_browser_plus.module b/media_browser_plus.module
index 9feab9c..607c80b 100644
--- a/media_browser_plus.module
+++ b/media_browser_plus.module
@@ -834,9 +834,10 @@ function media_browser_plus_form_file_entity_add_upload_alter(&$form, &$form_sta
'vocabulary' => 'media_folders',
'parent' => 0,
);
+ $field_folder_info = field_info_field('field_folder');
$form['field_folder'][LANGUAGE_NONE] = array(
@junaidpv
junaidpv / fix_file_usage_overcount.patch
Created September 2, 2015 13:04
Patch media module to fix over count of file usage due to conflict with filefield_paths module.
diff --git a/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc b/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
index cbc1e84..77611d4 100644
--- a/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
+++ b/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
@@ -12,7 +12,7 @@
* is heavy-handed, and should be replaced when Drupal's filter system is
* context-aware.
*/
-function media_wysiwyg_field_attach_insert($entity_type, $entity) {
+function media_wysiwyg_entity_insert($entity, $entity_type) {
@junaidpv
junaidpv / views_take_current_path_for_form_action.patch
Created September 7, 2015 18:35
Views forms are settings form's action URL from view display's configured URL. This make problems if menu got altered and view display got displayed on different path. This still incomplete and a try.
diff --git a/views.module b/views.module
index f46564c..ac70d40 100644
--- a/views.module
+++ b/views.module
@@ -1807,7 +1807,7 @@ function views_form($form, &$form_state, $view, $output) {
$form = array();
$query = drupal_get_query_parameters($_GET, array('q'));
- $form['#action'] = url($view->get_url(), array('query' => $query));
+ $form['#action'] = url(request_path(), array('query' => $query));
@junaidpv
junaidpv / load_media_wysiwyg_settings_and_filter-2331293.patch
Created October 5, 2015 15:09
Load media_wysiwyg settings and filter for quick editing with CKeditor.
diff --git a/quickedit.module b/quickedit.module
index 6c9ee5c..c8a29b9 100644
--- a/quickedit.module
+++ b/quickedit.module
@@ -144,6 +144,22 @@ function quickedit_page_build(&$page) {
// hence it will also clear this cache entry.
cache_set("quickedit_user_permissions_hash:$serialized_roles", $permissions_hash, 'cache_page', CACHE_TEMPORARY);
}
+
+ // Copied from media_wysiwyg.module:media_wysiwyg_pre_render_text_format()
@junaidpv
junaidpv / make_ckeditor_field_format_available_on_clien_side.patch
Created October 14, 2015 17:20
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.
@junaidpv
junaidpv / consider_quickedit_format_for_ckeditor.patch
Created October 14, 2015 17:22
Consider format value from quickedit module if ckeditor field format is not retrievable by id
diff --git a/editors/ckeditor/plugin.js b/editors/ckeditor/plugin.js
index 7cecc31..08b7493 100644
--- a/editors/ckeditor/plugin.js
+++ b/editors/ckeditor/plugin.js
@@ -49,6 +49,9 @@
}
else if (Drupal.settings.ckeditor) { // If using the CKEditor module
format = Drupal.settings.ckeditor.elements[editor.name];
+ if ((format == null || format === '') && Drupal.settings.quickedit.format) {
+ format = Drupal.settings.quickedit.format;
@junaidpv
junaidpv / reload_on_quickedit_close.patch
Created October 16, 2015 15:38
Patch for quickmodule to reload the app when toolbar is closed (not by saving). It is showing non-rendered media tags when toolbar is directly closed.
diff --git a/js/views/AppView.js b/js/views/AppView.js
index b477e7d..f8b4ab8 100644
--- a/js/views/AppView.js
+++ b/js/views/AppView.js
@@ -18,6 +18,9 @@
var reload = false;
Drupal.quickedit.AppView = Backbone.View.extend({
+ setReload: function (value) {
+ reload = value;
@junaidpv
junaidpv / highlight.css
Created March 7, 2016 09:12 — forked from akanehara/highlight.css
pandoc code-highlight css
code > span.kw { color: #268BD2; font-weight: bold; }
code > span.dt { color: #268BD2; }
code > span.dv { color: #D33682; }
code > span.bn { color: #D33682; }
code > span.fl { color: #D33682; }
code > span.ch { color: #4070a0; }
code > span.st { color: #2AA198; }
code > span.co { color: #93A1A1; font-style: italic; }
code > span.ot { color: #A57800; }
code > span.al { color: #CB4B16; font-weight: bold; }
@junaidpv
junaidpv / panels-pass_renderer_object_also_when_altering_pane_links.patch
Last active April 4, 2016 12:08
Pass renderer object reference while allowing to alter pane links. That is essentila for several cases.