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

PHP 7.4 Incompatibility of paypal/module-braintree-core 4.4.0-p2 #38150

Closed
1 of 5 tasks
norgeindian opened this issue Nov 6, 2023 · 7 comments
Closed
1 of 5 tasks

PHP 7.4 Incompatibility of paypal/module-braintree-core 4.4.0-p2 #38150

norgeindian opened this issue Nov 6, 2023 · 7 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p2 Indicates original Magento version for the Issue report.

Comments

@norgeindian
Copy link

Preconditions and environment

  • Magento version 2.4.5.-p2

Steps to reproduce

  1. Use PHP 7.4
  2. Run composer require paypal/module-braintree-core:4.4.0-p2
  3. According to the composer.json, this should be compatible with PHP 7.4 ("php": "~7.4.0||~8.1.0",)
  4. Run bin/magento setup:di:compile

Expected result

bin/magento setup:di:compile should not throw any error

Actual result

bin/magento setup:di:compile shows the following error message: MiBsyntax error, unexpected '|', expecting ';' or '

Additional information

Checking that issue more detailed, you will come to the class \PayPal\Braintree\Gateway\Command\GetPaymentNonceCommand with the following method:

public function execute(array $commandSubject): ArrayResult|ResultInterface|null
    {
        $publicHash = $this->subjectReader->readPublicHash($commandSubject);
...

Unfortunately, union types for return types are a PHP 8 feature and not available in PHP 7.4
So in end it seems as if this version of the module is not compatible with PHP 7.4, even though it is stated.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Nov 6, 2023

Hi @norgeindian. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented Nov 6, 2023

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.5-p2 Indicates original Magento version for the Issue report. label Nov 6, 2023
@engcom-Bravo
Copy link
Contributor

Hi @norgeindian,

Thank you for reporting and collaboration.

As per the Magento system requirements https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html Magento 2.4.5-p2 supports with php 8.1.

Could you please check system requirements and please let us know if you are facing any issue.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Nov 8, 2023
@norgeindian
Copy link
Author

@engcom-Bravo , that is correct. Magento indeed officially only supports PHP 8, even if it still works with PHP 7.4.
But paypal/module-braintree-core:4.4.0-p2 states to be compatible with PHP 7.4, which seems to be incorrect as I described.

@hostep
Copy link
Contributor

hostep commented Nov 9, 2023

Was reported before in: #37935

And even before that, I alerted at least 2 people from Adobe via Slack around this I believe somewhere in August 2023, they promised me they would deliver the message to the paypal team, but it seems like nothing has happened so far. And my guess would be that this will never get fixed. So I think your only chance is to replace the PHP 7.4 incompatible code with a composer patch.

It's also becoming time to move on to PHP 8, most 3rd party modules are compatible with 8.1 and even 8.2 by now, we hardly run into problems with PHP compatibility these days anymore. It's just your own custom code that you'll need to update if it's not compatible yet.

Also @engcom-Bravo: the "system requirements" documentation is not actually showing the system requirements, it's showing the software versions Adobe tested their code against, the actual requirements are far broader then what is displayed on that page. There was a community maintained system requirements document, but it has been abandoned unfortunately.

@engcom-Bravo
Copy link
Contributor

@hostep Thanks for your contribution here.

Hi @norgeindian,

Thanks for your update.

Currently Magento supports with php 8.1 and 8.2 could you please check the issue in the Latest released Magento Version and Magenti 2.4-develop branch.

Thanks.

@engcom-Bravo
Copy link
Contributor

Hi @norgeindian,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p2 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

3 participants