Skip to content
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

Got 500 in select payment #154

Closed
jdeveloper opened this issue Nov 7, 2020 · 7 comments
Closed

Got 500 in select payment #154

jdeveloper opened this issue Nov 7, 2020 · 7 comments

Comments

@jdeveloper
Copy link
Contributor

jdeveloper commented Nov 7, 2020

When I go to the page of selecting payment method a got the following error:

ArgumentCountError
Too few arguments to function Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType::__construct(), 0 passed in /var/www/html/vendor/symfony/form/FormRegistry.php on line 91 and at least 1 expected

Screenshot_20201107_120555

If I comment in src/Resources/config/services.xml of the plugin the following lines:

<service
    id="sylius.form.type.checkout_select_payment"
    class="Sylius\PayPalPlugin\Form\Type\SelectPaymentType"
>
    <argument>%sylius.model.order.class%</argument>
    <argument>%sylius.form.type.checkout_select_payment.validation_groups%</argument>
    <tag name="form.type" />
</service>

The page works becouse it takes de default SelectPaymentType of sylius.

@Zales0123
Copy link
Member

Hello @jdeveloper! Are you sure you use the latest version of the plugin (v1.0.0-RC.2 right now, 1.0.0 coming soon!)? It was indeed a bug but should be fixed a long time ago. Let me know if you check it out :) 🖖

@jdeveloper
Copy link
Contributor Author

@Zales0123 I am sure I use the latest version of the plugin. Here the entry in composer.lock

{
  "name": "sylius/paypal-plugin",
  "version": "v1.0.0-RC.2",
  "source": {
    "type": "git",
    "url": "https://github.com/Sylius/PayPalPlugin.git",
    "reference": "9f02b80dedc9ab79f227f79ee240109faaddc203"
  },
  "dist": {
    "type": "zip",
    "url": "https://api.github.com/repos/Sylius/PayPalPlugin/zipball/9f02b80dedc9ab79f227f79ee240109faaddc203",
    "reference": "9f02b80dedc9ab79f227f79ee240109faaddc203",
    "shasum": ""
  },
  "require": {
    "nyholm/append-query-string": "^0.1.1",
    "php": "^7.3",
    "phpseclib/phpseclib": "^2.0",
    "sylius/sylius": "^1.7"
  },
  "conflict": {
    "symplify/package-builder": "^8.3.24"
  },
  "require-dev": {
    "behat/behat": "^3.6.1",
    "behat/mink-selenium2-driver": "^1.4",
    "dmore/behat-chrome-extension": "^1.3",
    "dmore/chrome-mink-driver": "^2.7",
    "friends-of-behat/mink": "^1.8",
    "friends-of-behat/mink-browserkit-driver": "^1.4",
    "friends-of-behat/mink-extension": "^2.4",
    "friends-of-behat/page-object-extension": "^0.3",
    "friends-of-behat/suite-settings-extension": "^1.0",
    "friends-of-behat/symfony-extension": "^2.1",
    "friends-of-behat/variadic-extension": "^1.3",
    "lakion/mink-debug-extension": "^1.2.3",
    "phpspec/phpspec": "^6.1",
    "phpstan/phpstan": "0.12.25",
    "phpstan/phpstan-doctrine": "0.12.13",
    "phpstan/phpstan-webmozart-assert": "0.12.4",
    "phpunit/phpunit": "^8.5",
    "sensiolabs/security-checker": "^6.0",
    "sylius-labs/coding-standard": "^3.1",
    "symfony/browser-kit": "^4.4",
    "symfony/debug-bundle": "^4.4|^5.0",
    "symfony/dotenv": "^4.4|^5.0",
    "symfony/intl": "^4.4|^5.0",
    "symfony/web-profiler-bundle": "^4.4|^5.0",
    "symfony/web-server-bundle": "^4.4|^5.0",
    "vimeo/psalm": "3.11.4"
  },
  "type": "sylius-plugin",
  "extra": {
    "branch-alias": {
      "dev-master": "1.0-dev"
    }
  },
  "autoload": {
    "psr-4": {
      "Sylius\\PayPalPlugin\\": "src/",
      "Tests\\Sylius\\PayPalPlugin\\": "tests/"
    }
  },
  "notification-url": "https://packagist.org/downloads/",
  "license": [
    "MIT"
  ],
  "description": "PayPal plugin for Sylius.",
  "keywords": [
    "sylius",
    "sylius-plugin"
  ],
  "support": {
    "issues": "https://github.com/Sylius/PayPalPlugin/issues",
    "source": "https://github.com/Sylius/PayPalPlugin/tree/v1.0.0-RC.2"
  },
  "time": "2020-10-13T08:43:07+00:00"
}

@Zales0123
Copy link
Member

Thank you for your answer. I've just tried a fresh install of the plugin on both Sylius 1.7 and 1.8 and it worked well :/ Can you also tell me what exactly version of Sylius you use and do you use the sandbox mode of the plugin or not? It could be helpful :)

@jdeveloper
Copy link
Contributor Author

jdeveloper commented Nov 9, 2020

Thanks for yous answer. We are using

  • sylius v1.7.10
  • sylius plus v0.17.0
  • sylius/shop-api-plugin v1.0.0-beta.21 (we use this beta because some routes changed in the stable but we used the old one allready in production)

@Zales0123
Copy link
Member

It's strange... it still works for me 🤯 Can you debug the parameter sylius.form.type.checkout_select_payment.validation_groups and show me the result?

@jdeveloper
Copy link
Contributor Author

Hi

The result is

[ 'sylius' ]

@jdeveloper
Copy link
Contributor Author

Sorry for making you spend time. I just figured out that we have redifined the sylius_shop_checkout_select_payment route and so I had to change the form parameter, now it works. As you asked for the validation groups I went to search if the plugin had this route redefined so I found out the form parameter needed to be changed

Thanks for your attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants