Skip to content

Commit bcc2d5d

Browse files
committed
Merge branch 'release/0.1.11'
2 parents 82fc3a4 + 58eaa5c commit bcc2d5d

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/Field/FlexibleContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function fetchFields($fieldName, Builder $builder)
9999
$post = $this->post->ID != $meta->post_id ? $this->post->find($meta->post_id) : $this->post;
100100
$field = FieldFactory::make($meta->meta_key, $post);
101101

102-
if (!array_key_exists($id, $blocks)) {
102+
if ($field === null || !array_key_exists($id, $blocks)) {
103103
continue;
104104
}
105105

src/Field/Image.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public function get()
8585
*/
8686
protected function fillFields(Post $attachment)
8787
{
88+
$this->attachment = $attachment;
89+
8890
$this->mime_type = $attachment->post_mime_type;
8991
$this->url = $attachment->guid;
9092
$this->description = $attachment->post_excerpt;

src/Field/Repeater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function retrieveFieldName($metaKey, $fieldName, $id)
7474
*/
7575
protected function fetchPostsMeta($fieldName, Post $post)
7676
{
77-
$count = $this->fetchValue($fieldName, $post);
77+
$count = (int) $this->fetchValue($fieldName, $post);
7878
$builder = $this->postMeta->where('post_id', $post->ID);
7979
$builder->where(function ($query) use ($count, $fieldName) {
8080
foreach (range(0, $count - 1) as $i) {

0 commit comments

Comments
 (0)