Magento2: Parse error: syntax error, unexpected ')' in InvoiceTotal.php on line 89

Created on 22 Oct 2020  ·  9Comments  ·  Source: magento/magento2

Preconditions (*)

  1. Magento 2.4.1

Steps to reproduce (*)

  1. Running developer mode
  2. Run bin/magento setup:di:compile

Expected result (*)

  1. Succesfully finishing recompiling

Actual result (*)

  1. Parse error: syntax error, unexpected ')' in /var/www/vhosts/xxxxx/vendor/magento/module-sales-graph-ql/Model/Resolver/Invoice/InvoiceTotal.php on line 89

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [X] 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”._
Reported on 2.4.1 not-confirmed

Most helpful comment

Hi @jorgb90,
I see in the code we have trailing comma, that supported by php 7.3+ only (this is the minimum required php version for 2.4.x).

https://github.com/magento/magento2/blob/1353a546cc9aa4c6cc7f7d86763112d23645fcb7/app/code/Magento/SalesGraphQl/Model/Resolver/Invoice/InvoiceTotal.php#L86-L89

Please check your used php version on the web server using the phpversion() function.

Unfortunately we had incorrect minimum php version check in magento that allows to run Magento on older php version, already fixed it in https://github.com/magento/magento2/pull/29993

All 9 comments

Hi @jorgb90. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


  • Join Magento Community Engineering Slack and ask your questions in #github channel.

    :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

This doesn't seem to happen on a clean Magento 2.4.1 project.

Are you sure you haven't accidentally modified that file? (Or maybe your disk space is full and the file is only written halfway to the disk or something like that?)

Hi @engcom-Delta. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components 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.

Hi @jorgb90 thank you for your report, I'm not able to reproduce issue by steps you described on clean 2.4-develop and on 2.4.1
Result:
bin/magento setup:di:compile runs without errors
image

Could you provide additional details that helps to reproduce issue?

Mm strange. I didn't modify the file, but there was a .InvoiceTotal.php.swp file created in that dir, but the complete InvoiceTotal.php is also there.

Edit:
I have updated Magento 2.3.5-p2 to Magento 2.4.1, so its not a new 2.4.1 install.

Hi @ihor-sviziev. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components 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.

Hi @jorgb90,
I see in the code we have trailing comma, that supported by php 7.3+ only (this is the minimum required php version for 2.4.x).

https://github.com/magento/magento2/blob/1353a546cc9aa4c6cc7f7d86763112d23645fcb7/app/code/Magento/SalesGraphQl/Model/Resolver/Invoice/InvoiceTotal.php#L86-L89

Please check your used php version on the web server using the phpversion() function.

Unfortunately we had incorrect minimum php version check in magento that allows to run Magento on older php version, already fixed it in https://github.com/magento/magento2/pull/29993

Hi @ihor-sviziev,

That was it. I feel stupid.. Our dev environment is running on version v7.4.11, but the cli version was still at v7.2. I have updated the system PHP and now its working.

@jorgb90 ok, I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings