Open luxaloli opened 4 years ago
What does $request->request->getBoolean('subscribedToNewsletter')
return? Does it return true?
Ammm it never reaches that spot, as if never uses that overriden class.
Does it show up when running bin/console debug:config sylius_shop_api
?
Yes, it is the first one
sylius_shop_api:
request_classes:
register_customer: \App\Request\RegisterDaturaCustomerRequest
add_coupon: Sylius\ShopApiPlugin\Request\Cart\AddCouponRequest
add_product_review_by_code: Sylius\ShopApiPlugin\Request\Product\AddProductReviewByCodeRequest
add_product_review_by_slug: Sylius\ShopApiPlugin\Request\Product\AddProductReviewBySlugRequest
address_order: Sylius\ShopApiPlugin\Request\Checkout\AddressOrderRequest
assign_customer_to_cart: Sylius\ShopApiPlugin\Request\Cart\AssignCustomerToCartRequest
change_item_quantity: Sylius\ShopApiPlugin\Request\Cart\ChangeItemQuantityRequest
choose_payment_method: Sylius\ShopApiPlugin\Request\Checkout\ChoosePaymentMethodRequest
choose_shipping_method: Sylius\ShopApiPlugin\Request\Checkout\ChooseShippingMethodRequest
complete_order: Sylius\ShopApiPlugin\Request\Checkout\CompleteOrderRequest
drop_cart: Sylius\ShopApiPlugin\Request\Cart\DropCartRequest
generate_reset_password_token: Sylius\ShopApiPlugin\Request\Customer\GenerateResetPasswordTokenRequest
pickup_cart: Sylius\ShopApiPlugin\Request\Cart\PickupCartRequest
remove_coupon: Sylius\ShopApiPlugin\Request\Cart\RemoveCouponRequest
remove_item_from_cart: Sylius\ShopApiPlugin\Request\Cart\RemoveItemFromCartRequest
resend_verification_token: Sylius\ShopApiPlugin\Request\Customer\ResendVerificationTokenRequest
send_reset_password_token: Sylius\ShopApiPlugin\Request\Customer\SendResetPasswordTokenRequest
set_default_address: Sylius\ShopApiPlugin\Request\AddressBook\SetDefaultAddressRequest
update_customer: Sylius\ShopApiPlugin\Request\Customer\UpdateCustomerRequest
verify_account: Sylius\ShopApiPlugin\Request\Customer\VerifyAccountRequest
Very odd. I can't test it at the moment I would need to get back to you at this issue.
I tis weird also because on the view class already has the subscribedToNewsletter entry
Yeah, I think there is probably some configuration missing or cache or something like this.
This seems to be the same problem as mine, it never runs through the custom request class. I have tried it in different ways (use the service ID instead of the class, adding the request and command classes as well as the handler in services, ...) but nothing seems to work. I hope to find a solution soon, if I do I will also post it here.
I want to add the value of subscribedToNewsLetter from the create customer endpoint so i added this class
then as your doc says added this on _sylius_shop_api.yml
and also override the command interface, so this is the override class
it runs with no problem other than subscribedToNewsletter is always false, i am using this json for the api
Any idea of what is missing?