فهرست منبع

Merge pull request #120 from helmer/patch-2

[sluggable] fixed yaml mapping issue when there is no parameters set and sluggable is not an array key
Gediminas Morkevicius 14 سال پیش
والد
کامیت
9659f23117
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);