@@ -212,7 +212,8 @@ public function generateSlug(Model $Model) {
212
212
}
213
213
if (isset ($ Model ->data [$ alias ][$ field ])) {
214
214
if (is_array ($ Model ->data [$ alias ][$ field ])) {
215
- return $ this ->_multiSlug ($ Model );
215
+ $ this ->_multiSlug ($ Model );
216
+ return ;
216
217
}
217
218
$ slug [] = $ Model ->data [$ alias ][$ field ];
218
219
} elseif ($ Model ->id ) {
@@ -306,7 +307,7 @@ public function slug(Model $Model, $string, $tidy = true) {
306
307
$ i = 0 ;
307
308
$ suffix = '' ;
308
309
309
- while ($ Model ->hasAny ( $ conditions )) {
310
+ while (( bool ) $ Model ->find ( ' count ' , [ ' conditions ' => $ conditions, ' recursive ' => - 1 ] )) {
310
311
$ i ++;
311
312
$ suffix = $ separator . $ i ;
312
313
if ($ length && strlen ($ slug . $ suffix ) > $ length ) {
@@ -381,8 +382,7 @@ public function display(Model $Model, $id = null) {
381
382
* limit is set to allow a minimum 100 updates per second as a preventative measure.
382
383
*
383
384
* @param AppModel $Model
384
- * @param array $conditions
385
- * @param int $recursive
385
+ * @param array $params
386
386
* @return bool Success
387
387
*/
388
388
public function resetSlugs (Model $ Model , $ params = []) {
@@ -458,7 +458,7 @@ protected function _multiSlug(Model $Model) {
458
458
* @param mixed $replace
459
459
* @param mixed $string
460
460
* @param string $encoding
461
- * @return void
461
+ * @return string
462
462
*/
463
463
protected function _pregReplace ($ pattern , $ replace , $ string , $ encoding = 'UTF-8 ' ) {
464
464
if ($ encoding && $ encoding !== 'UTF-8 ' ) {
0 commit comments