Drupal

Drupal 8/9 - current_uri , current_path, Alias mit/ohne Language Code

Submitted by Gast (nicht überprüft) on Mo, 02/08/2021 - 14:46

Current Url



$current_url = Url::fromRoute('<current>');
$path = $current_url->toString();



 

Current Url : Internal Path / Route Name




$current_url->toString();    # /en/user/login
$current_url->getInternalPath();    # user/login
$path = $current_url->getRouteName();   # <current>


 

System Path



$path = \Drupal::request()->attributes->get('_system_path');

 

Drupal Forward Module durch (Re)Captcha schützen - sonst Spam ohne Ende über "forward-form-node-123" oder "forward-form-comment-123"

Submitted by Gast (nicht überprüft) on Fr, 06/19/2020 - 12:54

Drupal's Forward Module hat ein Nachteil: jedes Form hat eine numerische eindeutige ID, was unmöglich macht Formulare mit Captcha / Recaptcha zu schützen.

 

zB:

  •  forward-form-node-12345 (statt  forward-form-node)
  •  forward-form-comment-12345  (statt  forward-form-comment)

Deswegen ist ein Patch nötig.

Die Lösung

File:Line
modules\contrib\forward\src\Form\ForwardForm.php:187

 

Solarium 5.0.2 is too old and has known issues. In order to get composer to upgrade solarium to a recent version a core patch or a workaround is required. Have a look at this Core issue and this Search API Solr issue.

Submitted by Gast (nicht überprüft) on So, 12/22/2019 - 20:30

Problem:

Solarium 5.0.2 is too old and has known issues. In order to get composer to upgrade solarium to a recent version a core patch or a workaround is required. Have a look at this Core issue and this Search API Solr issue.

Lösung:

composer require symfony/event-dispatcher:"4.3.4 as 3.4.99" && composer update

 

Drupal Update Error: This branch of Entity Browser is not compatible with the version of Media Entity installed. (Currently using Entity Browser This branch of Entity Browser is not compatible with the version of Media Entity installed.)

Submitted by Gast (nicht überprüft) on Mi, 07/24/2019 - 12:24

Drupal Update 8.6.16 auf 8.7.5

Woran liegt das, dass ich so eine Meldung bekomme:

This branch of Entity Browser is not compatible with the version of Media Entity installed. (Currently using Entity Browser This branch of Entity Browser is not compatible with the version of Media Entity installed.)