diff --git a/wire/core/PaginatedArray.php b/wire/core/PaginatedArray.php index e94612ae..c8746a87 100644 --- a/wire/core/PaginatedArray.php +++ b/wire/core/PaginatedArray.php @@ -291,7 +291,7 @@ class PaginatedArray extends WireArray implements WirePaginatable { } else { - if($count > $limit) $count = $limit; + if($limit && $count > $limit) $count = $limit; $end = $start + $count; if($end > $total) $total = $end; $start++; // make 1 based rather than 0 based... diff --git a/wire/core/WireArray.php b/wire/core/WireArray.php index 029377e9..e40b231e 100644 --- a/wire/core/WireArray.php +++ b/wire/core/WireArray.php @@ -825,6 +825,7 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count */ public function getRandom($num = 1, $alwaysArray = false) { $items = $this->makeNew(); + if($num < 1) return $items; $count = $this->count(); if(!$count) { if($num == 1 && !$alwaysArray) return null; diff --git a/wire/modules/Fieldtype/FieldtypeComments/CommentStars.php b/wire/modules/Fieldtype/FieldtypeComments/CommentStars.php index d018052d..b76e91dc 100644 --- a/wire/modules/Fieldtype/FieldtypeComments/CommentStars.php +++ b/wire/modules/Fieldtype/FieldtypeComments/CommentStars.php @@ -52,9 +52,9 @@ class CommentStars extends WireData { foreach(self::$defaults as $key => $value) { $this->set($key, $value); } - $this->set('countLabelSingular', $this->_('%1$s (%2$s rating)')); - $this->set('countLabelPlural', $this->_('%1$s (%2$s ratings)')); - $this->set('unratedLabel', $this->_('not yet rated')); + if(!strlen($this->countLabelSingular)) $this->set('countLabelSingular', $this->_('%1$s (%2$s rating)')); + if(!strlen($this->countLabelPlural)) $this->set('countLabelPlural', $this->_('%1$s (%2$s ratings)')); + if(!strlen($this->unratedLabel)) $this->set('unratedLabel', $this->_('not yet rated')); } /**