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

Deprecated Functionality: Optional parameter #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manu-krishna
Copy link

Fix for Deprecated Functionality: Optional parameter $authentication declared before required parameter $expectedArgCount is implicitly treated as a required parameter

For support in magento 2.4.5 version with php 8+

@chirag-ontap
Copy link

@manu-krishna

Fix for Deprecated Functionality: Optional parameter $authentication declared before required parameter $expectedArgCount is implicitly treated as a required parameter

For support in magento 2.4.5 version with php 8+

@manu-krishna thank you for this PR.
Would you mind sharing the issue you faced due to this along with steps to replicate it?

@manu-krishna
Copy link
Author

@manu-krishna

Fix for Deprecated Functionality: Optional parameter $authentication declared before required parameter $expectedArgCount is implicitly treated as a required parameter
For support in magento 2.4.5 version with php 8+

@manu-krishna thank you for this PR. Would you mind sharing the issue you faced due to this along with steps to replicate it?

@chirag-ontap

If you try installing the module in magento 2.4.5 version which runs on php8, you will get the error.

  • php 8 deprecated required parameter follows optional parameter

so static function buildAuthenticationObject($authentication = null, $args, $expectedArgCount) on line number 268 in simplify-magento-module/lib/simplifycommerce-sdk-php/lib/Simplify/PaymentsApi.php required parameters $args and $expectedArgCount follows the optional parameter $authentication

When I checked abouut switching the parameter position, found that it will need updates in too many places hence made all parameters with default optional value.

This solved issue during setup:di:compile.

@harshitshah20
Copy link

@manu-krishna Thanks for the update. Can you please let us know at which step or which specific steps the error is appearing? We installed the module on Magento 2.4.5 + PHP 8.1 environment but we can't see the error.

@manu-krishna
Copy link
Author

@harshitshah20 I am getting the error when fresh installing the module code and running setup:di:compile

@manu-krishna
Copy link
Author

I am attaching a screenshot along with the reverted code

Screenshot 2022-11-21 at 1 45 30 PM

@harshitshah20
Copy link

@manu-krishna Thanks for the update. We will look further into this.

@agelospanagiotakis
Copy link

any progress on this one ?

@manu-krishna
Copy link
Author

@agelospanagiotakis No response or merge from their side. I think they will not merge pull requests from anyone other than their team. I applied the fix in my environment as i cannot wait for them to fix this. However this module has too much issues in latest version of magento. Sometimes the popup modal won't even show to enter card detais. Some ko-js error in console.

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