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

Criterion9 php 8 db handling #904

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

criterion9
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tested the changes
  • Build (/path/to/php cli.php cmd=build) was run locally and any changes were pushed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):
    This PR includes 2 adjustments to db handling based on changes in how PHP handles/returns things.

What is the current behavior?

PHP 8.x sometimes throws errors from empty query results or any variety of exceptions that could be thrown when using the mysqli query functions.
Issue Number: 893

What is the new behavior?

Less errors produced when using php 8.x (tested with 8.1 & 8.2)

Does this introduce a breaking change?

  • Yes
  • No

Docs need to be updated?

  • Yes
  • No

Other information

added a check to handle when a query has no results instead of referencing an index that doesn't exist, and return null instead of generating an error.
@criterion9 criterion9 mentioned this pull request Dec 24, 2023
3 tasks

owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
} catch(\Exception $e) {
$result = false;
Copy link

Choose a reason for hiding this comment

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

can we log the exception in $this->e->debug() as well, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may sound silly, but I'm not sure how to edit/update a PR. This would be the first one I have submitted with a request for changes. Is there a preferred process here?

Copy link

Choose a reason for hiding this comment

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

You can push any changes to the branch you used and they will automatically be included in the PR.

You can also edit individual files manually on GH.com (see menu on right side):

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added logging of the caught exception. Please let me know if I missed anything getting the PR updated.

Copy link

Choose a reason for hiding this comment

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

lgtm 👍

Added logging of caught exceptions
@tcreek
Copy link

tcreek commented Mar 9, 2024

It's running with your branch on 8.x?

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.

None yet

3 participants