summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit2018-10-05 12:37:16 (GMT)
committerOleh Vehera2018-10-05 12:37:16 (GMT)
commit122a36084eeb6d18f71ab48dd4d787bf4370cf92 (patch)
tree5fc3912b77b0c6fdf72ff3da7d9422a2a18fed67
parentff95354db41711c7751dfdaebc98fee9fa7d9900 (diff)
Issue #2997309 by sano, pifagor, alex_optim, voleger: Undefined index JS error when attempting to set content type field format to Lightbox
-rw-r--r--lightbox2.module18
1 files changed, 13 insertions, 5 deletions
diff --git a/lightbox2.module b/lightbox2.module
index ea5643e..3c27633 100644
--- a/lightbox2.module
+++ b/lightbox2.module
@@ -875,6 +875,7 @@ function lightbox2_field_formatter_settings_form($field, $instance, $view_mode,
return $form;
}
+
/**
* Implements hook_field_formatter_settings_summary().
*/
@@ -888,19 +889,26 @@ function lightbox2_field_formatter_settings_summary($field, $instance, $view_mod
$summary = '';
- if(isset($settings['caption']) && isset($settings['type']) && isset($settings['image_style']) && isset($settings['lightbox_style'])) {
- $summary .= '<strong>'.t('Caption field') . '</strong>: ' . $fields[$settings['caption']] . '<br/>';
- $summary .= '<strong>'.t('Display') . '</strong>: ' ;
+ if (!isset($image_styles[$settings['image_style']])) {
+ $image_styles[$settings['image_style']] = 0;
+ }
+ if (!isset($image_styles[$settings['lightbox_style']])) {
+ $image_styles[$settings['lightbox_style']] = 0;
+ }
+
+ if (isset($settings['caption']) && isset($settings['type']) && isset($settings['image_style']) && isset($settings['lightbox_style'])) {
+ $summary .= '<strong>' . t('Caption field') . '</strong>: ' . $fields[$settings['caption']] . '<br/>';
+ $summary .= '<strong>' . t('Display') . '</strong>: ';
$summary .= $types[$settings['type']];
$summary .= ': ';
$summary .= $image_styles[$settings['image_style']];
$summary .= ' => ';
$summary .= $image_styles[$settings['lightbox_style']];
- } else {
+ }
+ else {
$summary = 'Title - Lightbox: original => original';
}
-
return $summary;
}