소스 검색

[sluggable] fixed yaml mapping issue when there is no parameters set and sluggable is not an array key

Helmer Aaviksoo 14 년 전
부모
커밋
450fd059b2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php

+ 1 - 1
lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php

@@ -69,7 +69,7 @@ class Yaml extends File implements Driver
                         if (!$this->isValidField($meta, $field)) {
                             throw new InvalidMappingException("Cannot slug field - [{$field}] type is not valid and must be 'string' in class - {$meta->name}");
                         }
-                        $sluggable = $fieldMapping['gedmo']['sluggable'];
+                        $sluggable = (isset($fieldMapping['gedmo']['sluggable'])? $fieldMapping['gedmo']['sluggable']:array());
                         $slugField = (isset($sluggable['slugField'])? $sluggable['slugField']:'slug');
                         $position = (isset($sluggable['position'])? $sluggable['position']:0);
                         $config['fields'][$slugField][] = array('field' => $field, 'position' => $position, 'slugField' => $slugField);