|
PhpStorm |
7.50 |
LocalForward |
PhpStormから踏み台を使う |
|
SSH |
7.50 |
ProxyCommand |
SSH IP制限を1コマンドで通過する |
|
Apache2.4 |
7.50 |
|
Apache2.4のアクセス制限 |
|
サイトの構築 |
7.50 |
Module Missing Message Fixer |
モジュールをアンインストールしたらエラーがでるようになった |
|
drush |
7.54 |
Drush |
Drushでdrupalサイトをインストールする方法 |
|
ユーザの管理 |
7.50 |
Paypal continued billing |
drupal7のPaypal継続課金モジュールについて |
|
コンテンツの管理 |
7,51 |
Views Data Export |
Views Data ExportでCSVデータが欠けてしまう |
|
アップデート |
7.50 |
Download count |
DOWNLOAD MODULEページでダウンロードが失敗することがある |
|
開発 mail |
7.50 |
Mail Safety |
開発/テスト用サイトのメール |
|
メール |
7.50 |
Smtp |
smtpでGmailアカウントを使いたい |
|
jQuery Revolution |
7.50 |
|
jQuery Revolutionのリンクがスマホで機能しない |
|
CentOS |
7.50 |
|
消せないファイルを消すには |
|
権限 |
7.50 |
Cron |
Basic認証時のCron(wget)実行方法 |
|
PCRE |
7.50 |
|
preg_match()がおかしい |
|
コンテンツの作成 |
7.50 |
Inline Entity Form |
Drupal6のフィールドグループのようなモジュールはありませんか? |
|
ユーザ |
7.44 |
Quickbar |
会員の種別(役割)別にメニューを設けたい |
|
ユーザ |
7.44 |
Password Policy |
無効なユーザーを整理したい |
|
コンテンツの作成 |
7.50 |
Expanding Textareas |
Textareaフォームの行サイズを自動調整するモジュール |
|
コンテンツの作成 |
7.50 |
Code per Node |
ページ毎にCSSやJSを設定したい |
|
コンテンツの作成 |
7.34 |
Entityreference prepopulate |
新規ノード作成時のリファレンス方法 |
コメント
カスタムモジュールで対応
パーマリンク Submitted by actbrain on 2018/01/12 11:27.
カスタムモジュールで対応
module_name.info.yml
module_name.services.yml
services: module_name_event_subscriber: class: Drupal\module_name\EventSubscriber\Module_nameSubscriber tags: - {name: event_subscriber}src/EventSubscriber/Module_nameSubscriber.php
<?php namespace Drupal\min_init\EventSubscriber; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class Min_initSubscriber implements EventSubscriberInterface { public function checkForRedirection(GetResponseEvent $event) { $request_uri = $_SERVER['REQUEST_URI']; \Drupal::logger('min_init')->notice($request_uri); if (preg_match('!^(/node/[0-9]+/)(edit|clone/prepopulate).*?destination=node/[0-9]+$!', $request_uri, $m)) { $path = \Drupal\Core\Url::fromUserInput($m[1] . $m[2]); $response = new RedirectResponse($path->toString()); $response->send(); } } /** * {@inheritdoc} */ public static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = array('checkForRedirection'); return $events; } }ページ