Skip to content

Instantly share code, notes, and snippets.

View thelebster's full-sized avatar
:octocat:
Do nothing, it is ok.

Anton Lebedev thelebster

:octocat:
Do nothing, it is ok.
View GitHub Profile
@thelebster
thelebster / Drupal 7 Views - fix ajax attached to exposed filters.md
Last active March 10, 2020 10:32
Drupal 7 Views - fix ajax attached to exposed filters #cimpleodev #drupal #views

Ajax call does not trigger the callback function. This is related to the fact that the Views uses $_GET, and ajax uses $_POST.

Issue: https://www.drupal.org/node/1183418

Possible error message: "Invalid form POST data"

@thelebster
thelebster / init.rb
Last active August 29, 2015 14:17 — forked from lintaonz/init.rb
#
# vendor/plugins/redmine_wiki_html_util/init.rb
#
require 'redmine'
require 'open-uri'
Redmine::Plugin.register :redmine_gist do
name 'Redmine Wiki HTML Util'
author 'Arlo Carreon'
author_url 'http://www.arlocarreon.com/'
@thelebster
thelebster / README.md
Created March 21, 2015 17:03
Example of config.xml for File Conveyor daemon #cimpleodev #drupal #aws
name = MyModule
description = My Module
core = 7.x
package = MyModule
php = 5.2.4
dependencies[] = views
files[] = mymodule_handler_filter_fulltext.inc
@thelebster
thelebster / .install
Created May 11, 2015 14:54
Update image field settings to use Amazon Simple Storage Service as storage.
/**
* Update image field settings to use Amazon Simple Storage Service as storage.
*/
function MYMODULE_update_7004() {
// get list of fields
$fields = field_info_fields();
foreach ($fields as $field_name => $field) {
@thelebster
thelebster / drupal-test.js
Created September 30, 2015 04:25 — forked from rupl/drupal-test.js
This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-drupal-casperjs
/**
* @file
* Testing a demo of Drupal. The script will log in and check for various
* features in Drupal core. This demo was inspired by a similar script for
* a Wordpress site. The original script was written by Henrique Vicente.
*
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js
*/
// Set up variables to visit a URL and log in.
@thelebster
thelebster / hook_menu_block_blocks
Created October 30, 2015 05:09 — forked from jeffam/hook_menu_block_blocks
Default Menu Blocks
<?php
/**
* Implements hook_menu_block_blocks().
*/
function sidebar_menu_menu_block_blocks() {
// The array key is the block delta used by menu block.
return array(
'sidebar_subnav' => array(
'title_link' => TRUE,
'admin_title' => 'Current Menu Children',
@thelebster
thelebster / resend.php
Created November 19, 2015 18:51 — forked from gavinblair/resend.php
Drupal - resend activation email
<?php
$uid = 120;
$user = user_load(array('uid' => $uid));
$op = 'status_activated';
_user_mail_notify($op, $user);
@thelebster
thelebster / resend.php
Created November 19, 2015 18:51 — forked from signalpoint/resend.php
Drupal - resend welcome e-mails on users administration form.
<?php
/**
* Implements hook_user_operations().
*/
function example_user_operations() {
$operations = array(
'example_resend_welcome_email' => array(
'label' => t('Re-send welcome e-mail'),
'callback' => 'example_resend_welcome_email',
@thelebster
thelebster / fix-drupal-permissions.sh
Created January 20, 2016 13:07
Drupal - Bash shell script to fix Drupal permissions
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help