We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi ! Just found a bug:
When you override Location entity, the ShippingMethodTypeExtension still reference CoopTilleuls\SyliusClickNCollectPlugin\Entity\Location
ShippingMethodTypeExtension
CoopTilleuls\SyliusClickNCollectPlugin\Entity\Location
The form extension service should get the location class as argument in services.xml:
<service id="coop_tilleuls_click_n_collect.form.extension.type.shipping_method" class="CoopTilleuls\SyliusClickNCollectPlugin\Form\Extension\ShippingMethodTypeExtension"> <argument>%coop_tilleuls_click_n_collect.model.location.class%</argument> <tag name="form.type_extension" /> </service>
And the form extension should use it:
use Doctrine\ORM\EntityRepository; use Sylius\Bundle\ShippingBundle\Form\Type\ShippingMethodType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormBuilderInterface; /** * @author Kévin Dunglas <[email protected]> */ final class ShippingMethodTypeExtension extends AbstractTypeExtension { /** @var string */ private $className; /** * ShippingMethodTypeExtension constructor. * @param string $className */ public function __construct(string $className) { $this->className = $className; } public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('locations', EntityType::class, [ 'class' => $this->className, 'required' => false, 'multiple' => true, 'expanded' => true, 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('p') ->orderBy('p.name', 'ASC'); }, 'choice_label' => 'name', 'label' => 'coop_tilleuls_click_n_collect.form.shipping_method.locations', ]); } public static function getExtendedTypes(): iterable { return [ShippingMethodType::class]; } }
Tell me if you need me to open a PR, Have a good day !
The text was updated successfully, but these errors were encountered:
Hi ! Thanks for the feedback, could you open a PR please ?
Sorry, something went wrong.
@thcolin I opened a PR that fixes this, and some other places where the entity is used instead of the interface #54
No branches or pull requests
Hi ! Just found a bug:
When you override Location entity, the
ShippingMethodTypeExtension
still referenceCoopTilleuls\SyliusClickNCollectPlugin\Entity\Location
The form extension service should get the location class as argument in services.xml:
And the form extension should use it:
Tell me if you need me to open a PR,
Have a good day !
The text was updated successfully, but these errors were encountered: