-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible content and repeater fatal error #154
Comments
@alexadark Ah I see, ACF builder is relying on the 3rd party library to handle the automatic singular of a word for the button labels in the Flexible Content and Repeater field types. But if you don't have it installed with composer or installed manually it will fail. Probably not the best developer experience. The good thing is, it will only attempt to do so if acf-builder/src/FlexibleContentBuilder.php Lines 28 to 30 in e63ab87
acf-builder/src/FlexibleContentBuilder.php Lines 176 to 179 in e63ab87
So you should be able to pass it in, try: use StoutLogic\AcfBuilder\FieldsBuilder;
$content = new FieldsBuilder('page_content');
$content
->addFlexibleContent('sections', ['button_label' => 'Add Section'])
->addLayout('banner')
->addText('title')
->addWysiwyg('content')
->addLayout('content_columns')
->addRepeater('columns', ['min' => 1, 'max' => 2])
->addWysiwyg('content');
add_action('acf/init', function() use ($content) {
acf_add_local_field_group($content->build());
}); |
Thanks! everything works now! |
Hello,
I'm trying to add flexible content, and it gives errors, even by pasting the example
This is what happens on the WordPress side
Fatal error: Uncaught Error: Class 'Doctrine\Common\Inflector\Inflector' not found in /Users/alexandraspalato/Local Sites/agencytheme/app/public/wp-content/plugins/headlesswp-core/acf-builder/src/Traits/CanSingularize.php on line 18
Same thing happens with the repeater field
I'm much more a react dev, than PHP, but this is the example, so it should work...
I don't use composer, so I have installed acf-builder with autoload
The text was updated successfully, but these errors were encountered: