|
ブロック |
7.23 |
|
伸縮するfieldsetブロックを追加したい |
|
サイトの環境設定 |
7.23 |
Pathauto |
自動生成されるURLエイリアスがおかしい |
|
サイトの構築 |
7.22 |
Views |
フィールドセットの伸縮をノンプログラミングでやりたい |
|
サイトの構築 |
7.22 |
Views Devel |
Viewsの設定ページが変に? |
|
コンテンツの作成 |
7.22 |
node Views |
ノードに付いたコメントに関する情報を得る |
|
ユーザ |
7.22 |
Realname |
ユーザーIDではなくニックネーム等を表示したい |
|
PHP |
7.22 |
PHP |
ノードに付いたコメントを好きな場所に表示する |
|
サイトの構築 |
7.19 |
Plesk |
Pleskでdrupal7(プライベートファイルシステム)を使う場合の注意点 |
|
コンテンツの管理 |
7.16 |
PHP |
好きなところにノードを埋め込みたい |
|
アップデート |
7.16 |
Core |
7.15→7.16アップデート |
|
フォーム |
7.16 |
Webform, Mail System, Mime Mail, Jp Mail Helper |
送信メールのサブジェクトが長いと文字化けする |
|
フォーム |
7.15 |
Webform |
Webformで確認画面 |
|
コンテンツの管理 |
7.15 |
Content Access |
簡単に閲覧制限を行うには? |
|
Japanese mail |
7.15 |
Webform, Mail System, Mime Mail, Japanese Mail Helper |
Webformから文字化けしないメール送信を行うには |
|
フォーム |
7.15 |
system |
mail()での送信が失敗する |
|
フォーム |
7.15 |
Webform Template |
Webformを複写したい |
|
コンテンツの作成 |
7.15 |
Form API Validation |
フォームの入力内容を細かくチェックしたい |
|
言語 |
7.14 |
Entity Translation |
各フィールドのラベルの多言語切り替え漏れ(接頭子、接尾子) |
|
言語 |
7.15 |
Entity Translation |
各フィールドのラベルの多言語切り替え漏れ(フィールド・ラベル) |
|
言語 |
7.15 |
Entity Translation |
デフォルトの言語 - Entity Translation |
コメント
カスタムモジュールで対応
パーマリンク 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; } }ページ