This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable maintanance mode | |
drush state-set system.maintenance_mode 1 | |
# Backup file field data | |
drush sql-query "CREATE TABLE media__field_file_bak AS SELECT * FROM media__field_file;" | |
drush sql-query "CREATE TABLE media_revision__field_file_bak AS SELECT * FROM media_revision__field_file;" | |
# Truncate file field tables (need to change storage settings) | |
drush sql-query "TRUNCATE media__field_file;" | |
drush sql-query "TRUNCATE media_revision__field_file;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.field--name-field-media-oembed-video { | |
position: relative; | |
margin: 20px 0; | |
padding-bottom: 56.25%; /* 16:9 */ | |
padding-top: 25px; | |
height: 0; | |
iframe { | |
position: absolute; | |
top: 0; | |
left: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Drupal\commerce_product\Entity\ProductVariation; | |
$productvar = ProductVariation::load(328); | |
$status = $productvar->delete(); | |
ksm($status); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd | |
# set bash php to php7 | |
echo " | |
alias php7=\"/usr/local/php71/bin/php\" | |
alias composer=\"php7 -d memory_limit=-1 ~/tools/composer.phar\" | |
alias drupal=\"php7 -d memory_limit=-1 ~/tools/drupal.phar\"" >> ~/.bash_profile | |
mkdir tools | |
cd tools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Drupal 8 Use https://www.drupal.org/project/unused_modules module | |
# Next row code is for console dev tools at run at admin/config/development/unused_modules/projects/disabled | |
# var rows=jQuery('tbody tr');var results=[];jQuery.each(rows,function(i,v){locrow=jQuery(this);results.push(jQuery(locrow[0].children[0]).text());});console.log(results.join(' ')); | |
# Usage run command: sh module_remover.sh at your composer path | |
module_list=(unused_module1 unused_module2) | |
for i in ${module_list[@]}; do | |
composer remove drupal/$i | rm -rf modules/$i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove all drupal 7 users exept those with id on $keep var. | |
$users = entity_load('user'); | |
$keep = [ | |
1,348,647,648,690,649,646 | |
]; | |
foreach ($users as $uid => $user) { | |
if (!in_array($uid, $keep)) { | |
user_delete($uid); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
echo Are you at themes folder y/n? | |
read IS_THEME_FOLDER | |
if [ $IS_THEME_FOLDER != 'y' ];then | |
exit | |
fi | |
if ! [ -d bootstrap ];then | |
drush dl bootstrap | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Allow Vim-only settings even if they break vi keybindings. | |
set nocompatible | |
" Enable filetype detection. | |
filetype off | |
filetype plugin indent on | |
" Enable syntax highlighting | |
if &t_Co > 1 | |
syntax enable |