|
フォーム |
8.9.x |
Webform |
フォーム作成時のレイアウトについて |
|
サイトの環境設定 |
8.9.x |
|
編集 |
|
コンテンツの管理 |
8.9.x |
|
写真の変更を行いたい |
|
Migrate |
9.x |
drush config |
Upgrade source(環境) を 変更したときにやるべきこと |
|
PHP |
8.9.x |
drush |
drush sql:cli < が機能しない場合の対処 |
|
フォーム |
8.9.x |
Views |
Views exposed filterのフォームに#default_valueを仕込む方法 |
|
テーマ |
8.9.x |
|
スマホに向いたテーマについて |
|
アップデート |
8.9.x |
composer patch |
patch を composer に 組み込む方法 |
|
PHP-FPM |
8.9.x |
PHP |
PHP-FPM 環境で .htaccess に php_value を 書いてもダメ |
|
サイトの構築 |
8.9.x |
Webform |
drupalを使用した登録、一覧表示の方法について |
|
アップデート |
8.9.x |
Composer update |
Composer で drupal/core-8.9.7 に更新できなくなった場合の処置 |
|
サイトの構築 |
7.59 |
Drupal.ajax |
drupal 7 で Uncaught TypeError: Drupal.ajax is undefined となったときの対応方法 |
|
Proxy |
7.59 |
Proxy Apache settings.php |
リバースプロキシ(Apache)+バックグランドWeb(Drupal 7 )でログインセッションを維持する方法 |
|
リバースプロキシ |
8.9.x |
mod_proxy mod_proxy_http mod_ssl |
Apache2.4 から httpsサーバーへリバースプロキシする方法 |
|
コンテンツの作成 |
8.9.x |
node |
ノード保存時の前回値の参照方法 |
|
サイト情報 |
8.9.x |
api |
Drupal::request() メモ |
|
テーマ |
8.9.x |
Twig |
Twig で 月末日を算出する方法 |
|
SESSION |
8.9.x |
api |
$_SESION操作のAPI |
|
フォーム |
8.9.x |
api |
GET/POSTされた情報を得る方法 |
|
テーマ |
8.9.x |
patch パッチ |
開発環境のファイル変更を本番環境にパッチでデプロイする方法(画像含まず) |
コメント
カスタムモジュールで対応
パーマリンク 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; } }ページ