Skip to content

Commit

Permalink
Merge branch 'release/0.1.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrossi committed Apr 27, 2017
2 parents 82fc3a4 + 58eaa5c commit bcc2d5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Field/FlexibleContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function fetchFields($fieldName, Builder $builder)
$post = $this->post->ID != $meta->post_id ? $this->post->find($meta->post_id) : $this->post;
$field = FieldFactory::make($meta->meta_key, $post);

if (!array_key_exists($id, $blocks)) {
if ($field === null || !array_key_exists($id, $blocks)) {
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Field/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public function get()
*/
protected function fillFields(Post $attachment)
{
$this->attachment = $attachment;

$this->mime_type = $attachment->post_mime_type;
$this->url = $attachment->guid;
$this->description = $attachment->post_excerpt;
Expand Down
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 bcc2d5d

Please sign in to comment.