Skip to content

Instantly share code, notes, and snippets.

View codexmas's full-sized avatar

Gordon Christmas codexmas

View GitHub Profile
<?php
use Drupal\Core\Database\Database;
function lotus_update_8001(&$sandbox) {
$spec = [
'type' => 'varchar',
'description' => "New Col",
'length' => 20,
'not null' => FALSE,
<?php
/**
* Implements hook_install().
*
* Creates some default entries on this module custom table.
*
* @see hook_install()
*
* @ingroup lotus
*/
@codexmas
codexmas / 0_reuse_code.js
Created February 28, 2017 16:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
diff --git a/docroot/profiles/commons/modules/contrib/og/includes/og.membership.inc b/docroot/profiles/commons/modules/contrib/og/includes/og.membership.inc
index 5691354..daa6014 100644
--- a/docroot/profiles/commons/modules/contrib/og/includes/og.membership.inc
+++ b/docroot/profiles/commons/modules/contrib/og/includes/og.membership.inc
@@ -23,8 +23,8 @@ class OgMembership extends Entity {
throw new OgException('OG membership can not be created for anonymous user.');
}
- $wrapper = entity_metadata_wrapper($entity_type, $etid);
- $bundle = $wrapper->getBundle();
@codexmas
codexmas / gist:3229207
Created August 1, 2012 17:49
JQuery; Drupal; Unbinding Ctools autosubmit on exposed filters
// Unbind ctools textfield binding
$('input[type=text].ctools-auto-submit:not(.ctools-auto-submit-processed),.ctools-auto-submit-full-form input[type=text]:not(.ctools-auto-submit-processed)').unbind('keyup');
// Bind to any textfield widgets that will be auto submitted.
$('input[type=text].ctools-auto-submit:not(.ctools-auto-submit-processed),.ctools-auto-submit-full-form input[type=text]:not(.ctools-auto-submit-processed)')
.addClass('.ctools-auto-submit-processed')
.blur(function () {
var form = this.form;
if (!$(form).hasClass('ctools-ajaxing')) {
$(form).find('.ctools-auto-submit-click').click();
}