소스 검색

Fixed error when nullable not explicitly set on slug field

Daniel Holmes 13 년 전
부모
커밋
da018f7956
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/Gedmo/Sluggable/SluggableListener.php

+ 1 - 1
lib/Gedmo/Sluggable/SluggableListener.php

@@ -214,7 +214,7 @@ class SluggableListener extends MappedEventSubscriber
             // if slug is changed, do further processing
             if ($needToChangeSlug) {
                 $mapping = $meta->getFieldMapping($slugFieldConfig['slug']);
-                if (!strlen(trim($slug)) && !$mapping['nullable']) {
+                if (!strlen(trim($slug)) && !isset($mapping['nullable']) || !$mapping['nullable']) {
                     throw new \Gedmo\Exception\UnexpectedValueException("Unable to find any non empty sluggable fields for slug [{$slugField}] , make sure they have something at least.");
                 }