浏览代码

fixed notice index undefined

bach 2 年之前
父节点
当前提交
bc6d04ef48
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      web/themes/custom/popsu/popsu.theme

+ 2 - 2
web/themes/custom/popsu/popsu.theme

@@ -76,8 +76,8 @@ function popsu_preprocess_region(&$variables) {
 
 function popsu_preprocess_views_view_field(&$variables){
   // check if link to entoty option is true
-  $settings = $variables['field']->options['settings']; 
-  if (isset($settings['link_to_entity']) && $settings['link_to_entity']) {
+  $settings = isset($variables['field']->options['settings']) ? $variables['field']->options['settings'] : false; 
+  if ($settings && isset($settings['link_to_entity']) && $settings['link_to_entity']) {
     // get the entity and build the classes
     $entity = $variables['row']->_entity;
     // $target_id = $entity;