Commit c7f46e87 authored by frjo's avatar frjo
Browse files

Fixes for 8.0.0-beta3.

parent 3cb5bf0b
......@@ -6,6 +6,7 @@
*/
use Drupal\Core\Template\Attribute;
use Drupal\Component\Utility\Unicode;
/**
* Prepares variables for colorbox formatter templates.
......@@ -69,7 +70,7 @@ function template_preprocess_colorbox_formatter(&$variables) {
$config = \Drupal::config('colorbox.settings');
$colorbox_style = $config->get('colorbox_style');
$trim_length = $config->get('colorbox_caption_trim_length');
if (((strpos($colorbox_style, 'colorbox/example') !== FALSE) || $config->get('colorbox_caption_trim')) && (drupal_strlen($caption) > $trim_length)) {
if (((strpos($colorbox_style, 'colorbox/example') !== FALSE) || $config->get('colorbox_caption_trim')) && (Unicode::strlen($caption) > $trim_length)) {
$caption = drupal_substr($caption, 0, $trim_length - 5) . '...';
}
......@@ -114,7 +115,7 @@ function template_preprocess_colorbox_formatter(&$variables) {
$variables['image']['#attributes'] = $item_attributes;
// Do not output an empty 'title' attribute.
if (drupal_strlen($item->title) != 0) {
if (Unicode::strlen($item->title) != 0) {
$variables['image']['#title'] = $item->title;
}
......
......@@ -5,6 +5,8 @@
* A light-weight, customizable lightbox plugin for jQuery 1.3
*/
use Drupal\Component\Utility\Unicode;
/**
* The default path to the Colorbox directory.
*/
......@@ -183,11 +185,11 @@ function _colorbox_active() {
// Convert path to lowercase. This allows comparison of the same path
// with different case. Ex: /Page, /page, /PAGE.
$config = \Drupal::config('colorbox.settings');
$pages = drupal_strtolower(_colorbox_array_to_string($config->get('advanced.pages')));
$pages = Unicode::strtolower(_colorbox_array_to_string($config->get('advanced.pages')));
// Compare the lowercase path alias (if any) and internal path.
$path = current_path();
$path_alias = drupal_strtolower(\Drupal::service('path.alias_storage')->lookupPathAlias($path, 'en'));
$path_alias = Unicode::strtolower(\Drupal::service('path.alias_storage')->lookupPathAlias($path, 'en'));
$page_match = drupal_match_path($path_alias, $pages);
if ($path_alias != $path) {
$page_match = $page_match || drupal_match_path($path, $pages);
......
......@@ -211,7 +211,7 @@ class ColorboxFormatter extends ImageFormatterBase {
$cache_tags = array();
if (!empty($settings['colorbox_node_style'])) {
$image_style = entity_load('image_style', $settings['colorbox_node_style']);
$cache_tags = $image_style->getCacheTag();
$cache_tags = $image_style->getCacheTags();
}
foreach ($items as $delta => $item) {
......
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