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

Add missing member variable in sync_model.php to fix issue #36 #37

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

davefiddes
Copy link
Contributor

Issue #36 was caused by the $feed member variable in the Sync class not being delcared in the class. This was permitted prior to php 8.2 but will now raise a warning. The warning corrupts the JSON output preventing the function from working.

Tests:

  • Sync several feed from an upstream stable emoncms instance

Issue emoncms#36 was caused by the $feed member variable in the Sync
class not being delcared in the class. This was permitted prior to
php 8.2 but will now raise a warning. The warning corrupts the JSON
output preventing the function from working.

Tests:
 - Sync several feed from an upstream stable emoncms instance
@glynhudson
Copy link
Member

Thanks, will this be backwards compatible with PHP7?

@davefiddes
Copy link
Contributor Author

It should be fine but I haven't tested it. My change is just adding another member variable using the standard php class syntax. It seems to be just an omission and not an intentional use of a dynamic property. FWIW the rest of emoncms seems to work fine with php 8.2.

The docs for php 8.2 explain the reasoning: https://wiki.php.net/rfc/deprecate_dynamic_properties

@reedy
Copy link
Contributor

reedy commented Aug 27, 2023

Thanks, will this be backwards compatible with PHP7?

Unless something elsewhere is expecting it to be public, it is, yeah

@glynhudson glynhudson merged commit 0d37df2 into emoncms:master Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants