Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
398 stars 53 forks source link

Type error in v3.0.11 #215

Closed mike-sheppard closed 4 months ago

mike-sheppard commented 4 months ago

Hey @Log1x, not 100% if this is an issue my side or not, but only thrown in latest ACF Composer (v3.0.11)

($fields) must be of type array, string given
called in vendor/log1x/acf-composer/src/Field.php on line 25

2024-02-29 1343 - Arc

Log1x commented 4 months ago

do you have example code of the Composer it's erroring on?

mike-sheppard commented 4 months ago

EDITED: Removed Block code as it wasn't the cause + keep the issue tidy

That probs wasn't v. helpful, but just dumped $fields. Looks like a string is being returned from one of our Options - still looking into it, but thought worth sharing quickly.

2024-02-29 1403 - Arc

mike-sheppard commented 4 months ago

yup, it's this:

<?php

namespace App\Fields;

use Log1x\AcfComposer\Field;
use Log1x\AcfComposer\Builder;

class PostOptions extends Field {
    public function fields() {
        $page = Builder::make('post_options', [
            'position' => 'side',
        ]);

        $page
            ->setLocation('post_type', '==', 'post')
        ;

        return $page->build();
    }
}
mike-sheppard commented 4 months ago

Going to remove it as no fields are being defined (guess we've left it in there as a placeholder for future). But just a heads up this hadn't thrown any errors until v3.0.11