Commit f6f0ef98 authored by facine's avatar facine Committed by frjo
Browse files

Issue #2624258 by facine: Check if Colorbox should be active for the current...

Issue #2624258 by facine: Check if Colorbox should be active for the current page fails in a multilanguage site with language prefix
parent bf14e47f
......@@ -173,7 +173,7 @@ function _colorbox_active() {
$pages = Unicode::strtolower(_colorbox_array_to_string($config->get('advanced.pages')));
// Compare the lowercase path alias (if any) and internal path.
$path = Url::fromRoute('<current>')->toString();
$path = \Drupal::service('path.current')->getPath();
$path_alias = Unicode::strtolower(\Drupal::service('path.alias_storage')->lookupPathAlias($path, 'en'));
$page_match = \Drupal::service('path.matcher')->matchPath($path_alias, $pages);
if ($path_alias != $path) {
......
......@@ -294,7 +294,11 @@ class ColorboxSettingsForm extends ConfigFormBase {
'#type' => 'textarea',
'#title' => '<span class="element-invisible">' . t('Pages') . '</span>',
'#default_value' => _colorbox_array_to_string($config->get('advanced.pages')),
'#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
'#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array(
'%user' => '/user',
'%user-wildcard' => '/user/*',
'%front' => '<front>',
)),
);
$form['colorbox_advanced_settings']['colorbox_compression_type'] = array(
'#type' => 'radios',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment