Skip to content

Conversation

@Konamiman
Copy link
Contributor

@Konamiman Konamiman commented Feb 21, 2024

Changes proposed in this Pull Request:

A user is reporting the following error after upgrading to WooCommerce 8.6:

PHP Parse error:  syntax error, unexpected 'LegacyProxy' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /home/................../public_html/wp-content/plugins/woocommerce/src/Internal/TransientFiles/TransientFilesEngine.php on line 48

While this looks like an error due to WooCommerce running in PHP 7.3 or older, the fact is that this is actually happening in PHP 7.4.

At this point it's not clear why this is happening, but for now the type hint is being removed, so that the transient files engine (which is a dependency of the receipts printing engine) doesn't break. Similar type hints in ReceiptRenderingEngine are removed too.

How to test the changes in this Pull Request:

Running the unit tests should be enough. Optionally, you can also repeat the tests of #43502.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@Konamiman Konamiman self-assigned this Feb 21, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 21, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2024

Test Results Summary

Commit SHA: 8cfe801

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests291005303447m 37s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

Copy link
Contributor

@lsinger lsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s another instance of private LegacyProxy $legacy_proxy in plugins/woocommerce/src/Internal/ReceiptRendering/ReceiptRenderingEngine.php. Let's remove that as well.

@Konamiman Konamiman changed the title Remove property type hint in TransientFilesEngine Remove property type hints in TransientFilesEngine and ReceiptRenderingEngine Feb 21, 2024
Copy link
Contributor

@lsinger lsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚢

@Konamiman Konamiman closed this Feb 21, 2024
@Konamiman Konamiman reopened this Feb 21, 2024
@Konamiman Konamiman closed this Feb 21, 2024
@Konamiman Konamiman reopened this Feb 21, 2024
@Konamiman Konamiman merged commit eb9723e into trunk Feb 22, 2024
@Konamiman Konamiman deleted the remove_type_hint_in_property_in_transient_files_engine branch February 22, 2024 07:59
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 22, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 22, 2024
@veljkho veljkho added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants