Drupal tips

Nid: 30
  • Directory /home/username/.drush/cache/default exists, but is not writable. Please check directory permissions.
$ sudo chown -R $USER ~/.drush

 

  • Views出力データの重複削除

"Edit view"
"Advanced > OTHER > Query setting: Setting"
Check "Distinct" check-box.

 

  • アップロードファイルのサイズ制限変更
$ sudo vim /etc/php5/apache2/php.ini
post_max_size = 64M

 

  • ユーザ一覧
$ drush sqlq "SELECT GROUP_CONCAT(name) FROM users"
GROUP_CONCAT(name)
,admin,claire_gill,nayeli,noorkali,pericles

 

  • ユーザ情報一覧
$ drush uinf $(drush sqlq "SELECT GROUP_CONCAT(name) as '' FROM users") | head
 User ID       :  0
 User name     :
 User mail     :
 User roles    :  anonymous user
 User status   :  blocked

 User ID       :  1
 User name     :  admin
 User mail     :  octaviadata@outlook.com
 User roles    :  authenticated user, administrator

 

  • 全サイトのユーザ一覧確認
$ for site in $(find /var/www/html -mindepth 1 -maxdepth 1 -type d -printf '%f '); do cd /var/www/html/$site; echo; echo -n "$site:"; drush sqlq "SELECT GROUP_CONCAT(name) as '' FROM users"; done