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 8.1 compatibility] don't pass null to PDOStatement::fetch() #17689

Merged
merged 3 commits into from Aug 2, 2021

Conversation

Findus23
Copy link
Member

refs #17686

fixes

WARNING [2021-06-17 22:27:06] 321855 /home/lukas/public_html/matomophp8/libs/Zend/Db/Statement/Pdo.php(257): Deprecated - PDOStatement::fetch(): Passing null to parameter #2 ($cursorOrientation) of type int is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
WARNING [2021-06-17 22:28:30] 322336 /home/lukas/public_html/matomophp8/libs/Zend/Db/Statement/Pdo.php(257): Deprecated - PDOStatement::fetch(): Passing null to parameter #3 ($cursorOffset) of type int is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

in php 8.1

defaults were taken from https://www.php.net/manual/de/pdostatement.fetch.php (the style one didn't output an error, but I changed it nevertheless)

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@Findus23 Findus23 added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. Needs Review PRs that need a code review labels Jun 17, 2021
@Findus23 Findus23 mentioned this pull request Jun 17, 2021
38 tasks
@diosmosis
Copy link
Member

@Findus23 FETCH_DEFAULT does not appear to be defined until 8.0.7. We'll need to try another approach.

@sgiehl
Copy link
Member

sgiehl commented Jun 18, 2021

As the default should be FETCH_BOTH, why not using this?

@sgiehl
Copy link
Member

sgiehl commented Jun 18, 2021

there are quite a lot tests failing not sure what's causing it...

@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jun 26, 2021
@Findus23
Copy link
Member Author

Findus23 commented Jun 26, 2021

@matomo-org/core-reviewers, It seems like the github actions bot is not able to ping the team.
Really weird.

Seems like I also can't and it is not in the list of suggestions. Maybe there is a setting in the team that needs to be changed.

@github-actions github-actions bot removed the Stale The label used by the Close Stale Issues action label Jun 27, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2021

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jul 5, 2021
@diosmosis diosmosis added the Do not close PRs with this label won't be marked as stale by the Close Stale Issues action label Jul 5, 2021
@github-actions github-actions bot removed the Stale The label used by the Close Stale Issues action label Jul 6, 2021
@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 14, 2021
@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 22, 2021
it's set in the method if null was given
@sgiehl sgiehl changed the title don't pass null to PDOStatement::fetch() [PHP 8.1 compatibility] don't pass null to PDOStatement::fetch() Jul 22, 2021
@sgiehl sgiehl requested a review from diosmosis July 22, 2021 15:27
@sgiehl sgiehl removed the Do not close PRs with this label won't be marked as stale by the Close Stale Issues action label Jul 22, 2021
@sgiehl
Copy link
Member

sgiehl commented Jul 22, 2021

I've changed the code slightly. The default value for the first parameter was actually not needed, as it is set within the method. Should be ready for a final review.

@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jul 30, 2021
@diosmosis diosmosis added this to the 4.5.0 milestone Jul 30, 2021
@diosmosis diosmosis added Do not close PRs with this label won't be marked as stale by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 30, 2021
@sgiehl sgiehl removed the Needs Review PRs that need a code review label Jul 30, 2021
@sgiehl sgiehl merged commit f21acfe into 4.x-dev Aug 2, 2021
@sgiehl sgiehl deleted the pdo-fetch-defaults branch August 2, 2021 09:57
@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not close PRs with this label won't be marked as stale by the Close Stale Issues action not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants