Skip to content

Commit

Permalink
Merge pull request #31 from WP4Laravel/feature/hardcast-int
Browse files Browse the repository at this point in the history
Added a hardcast to (int) on a field used in a range
  • Loading branch information
jgrossi authored Apr 27, 2017
2 parents abaa46d + e37a557 commit 1f28c8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Field/Repeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function retrieveFieldName($metaKey, $fieldName, $id)
*/
protected function fetchPostsMeta($fieldName, Post $post)
{
$count = $this->fetchValue($fieldName, $post);
$count = (int) $this->fetchValue($fieldName, $post);
$builder = $this->postMeta->where('post_id', $post->ID);
$builder->where(function ($query) use ($count, $fieldName) {
foreach (range(0, $count - 1) as $i) {
Expand Down

0 comments on commit 1f28c8b

Please sign in to comment.