Skip to content

Incorrect documentation for overriding the view of a resource form #362

@DanielCAlex

Description

@DanielCAlex

latest

The config reference suggests to overwrite a resource's form rendering as such

sylius_resource:
    resources:
        app.book:
            driver: doctrine/orm
            classes:
            options:
                object_manager: default
            templates:
                form: Book/_form.html.twig

However Configuration.php suggests the only acceptable value is a scalar

 private function addResourcesSection(ArrayNodeDefinition $node): void
    {
        $node
            ->children()
                ->arrayNode('resources')
                    ->useAttributeAsKey('name')
                    ->arrayPrototype()
                        ->children()
                            ->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end()
                            ->variableNode('options')->end()
                            ->scalarNode('templates')->cannotBeEmpty()->end()

So when I configure:

sylius_resource:
  resources:
etc etc etc
      templates:
        form: Admin/Ruleset/_form.html.twig

I get:
Invalid type for path "sylius_resource.resources.skyboundtech.wholesale_ruleset.templates". Expected "scalar", but got "array".

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConfirmed bugs or bugfixes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions