Sylius version affected: 1.x (I believe all of them, from the 1.0. 1.3 for sure)
Description
In order to fetch entities from an API and then display them in a grid, we have to create at least a new Driver and register it.
The thing is, when trying to register the new Driver in SyliusGrid, this exception is thrown :
The value "your/driver" is not allowed for path "sylius_resource.drivers.1". Permissible values: "doctrine/orm", "doctrine/mongodb-odm", "doctrine/phpcr-odm"
This is due to this in Sylius\Bundle\ResourceBundle\DependencyInjection\Configuration.php
...
/**
* @param ArrayNodeDefinition $node
*/
private function addDriversSection(ArrayNodeDefinition $node): void
{
$node
->children()
->arrayNode('drivers')
->defaultValue([SyliusResourceBundle::DRIVER_DOCTRINE_ORM])
->enumPrototype()->values(SyliusResourceBundle::getAvailableDrivers())->end()
->end()
->end()
;
}
...
So the first step is (do not reproduce at home) to override the availableDrivers and add our (all done in vendor...)
Then, in Sylius\Bundle\ResourceBundle\AbstractResourceBundle, there is a switch/case to also mpodify and add our new value.
Next step (nearly last one) we also have to override the switch/case in Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\DriverProvider
And to finish, we are warned that the XML file of our provider does not exist. So we create a new one in
Sylius/resource-bundle/Resources/config/services/integration/your/driver.xml
Steps to reproduce
Install Sylius (GridBundle at least) and try to add a new Provider
Possible Solution
Be more permissive in this bundle configuration. It is just one step away from being able to fetch data in API and display them in a grid.
Sylius version affected: 1.x (I believe all of them, from the 1.0. 1.3 for sure)
Description
In order to fetch entities from an API and then display them in a grid, we have to create at least a new Driver and register it.
The thing is, when trying to register the new Driver in SyliusGrid, this exception is thrown :
The value "your/driver" is not allowed for path "sylius_resource.drivers.1". Permissible values: "doctrine/orm", "doctrine/mongodb-odm", "doctrine/phpcr-odm"
This is due to this in Sylius\Bundle\ResourceBundle\DependencyInjection\Configuration.php
So the first step is (do not reproduce at home) to override the availableDrivers and add our (all done in vendor...)
Then, in Sylius\Bundle\ResourceBundle\AbstractResourceBundle, there is a switch/case to also mpodify and add our new value.
Next step (nearly last one) we also have to override the switch/case in Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\DriverProvider
And to finish, we are warned that the XML file of our provider does not exist. So we create a new one in
Sylius/resource-bundle/Resources/config/services/integration/your/driver.xml
Steps to reproduce
Install Sylius (GridBundle at least) and try to add a new Provider
Possible Solution
Be more permissive in this bundle configuration. It is just one step away from being able to fetch data in API and display them in a grid.