openemr icon indicating copy to clipboard operation
openemr copied to clipboard

bug: find and fix easy php warnings, deprecations or errors

Open stephenwaite opened this issue 1 year ago • 2 comments

Describe the bug

review these type of php issues in the main demos php error log and then open a PR with a fix :)

[30-Jul-2024 08:20:14 UTC] PHP Deprecated: Creation of dynamic property OpenEMR\Common\Auth\OAuth2KeyConfig::$cryptoGen is deprecated in /var/www/localhost/htdocs/openemr/src/Common/Auth/OAuth2KeyConfig.php on line 51

stephenwaite avatar Jul 30 '24 19:07 stephenwaite

I would like to work on this

audrie-nielsen avatar Nov 22 '24 21:11 audrie-nielsen

Hello i want to work on this

SSJGoku47 avatar Nov 23 '24 04:11 SSJGoku47

Hi, is it possible if I can work on this too?

migumnakkittikul avatar Sep 24 '25 19:09 migumnakkittikul

hi @migumnakkittikul , definitely ok. go for it

bradymiller avatar Sep 25 '25 03:09 bradymiller

This may help. It's a shell script that fetches the log, removes the debug throttling lines, removes the timestamps, and deduplicates the remaining entries without changing their order. (Sorting would make the tracebacks much harder to read.)

It isn't perfect, but I think it's a good blend of simple and functional.

curl https://demo.openemr.io/log/logPhp.txt |
    grep -vF 'DEBUG: throttling' |
    sed -e 's/^\[[^]]*] //' -e 's/^\[[^]]*]//' |
    awk '!s[$0]++'

kojiromike avatar Sep 25 '25 20:09 kojiromike

Looking at this log, I am beginning to wonder how many of these warnings and errors are due to someone (or somebot) directly requesting a url to a php file that is intended to be included in another page instead of run directly.

kojiromike avatar Sep 27 '25 17:09 kojiromike

Issues from reducedLog.txt analysis

Found and reported the following PHP warnings/errors from log analysis:

  • [ ] #9470 - Undefined $tokens array in RxList::parseToTokens() (HIGH priority - hundreds of warnings)
  • [ ] #9471 - Undefined variables in find_code_dynamic_ajax.php when $what == 'codes'
  • [ ] #9472 - Undefined array keys in CAMOS form
  • [x] #9459 - Multiple undefined array key/variable warnings in transfer_summary form (already reported)

Also added comment to #9451 documenting 4 additional files needing direct access guards.

kojiromike avatar Nov 16 '25 01:11 kojiromike

Alrighty, I believe I've accounted for all the issues that I saw in the logs yesterday that I can't rule out were already fixed in 7.0.4. I created issues for all of them, and made them sub-issues of this ticket for tracking. There may be new issues in future logs, especially because #9451 can't be solved until openemr has a front controller, but we can definitely tackle a bunch of these.

kojiromike avatar Nov 16 '25 01:11 kojiromike

@stephenwaite what do you think about closing this ticket once all the subtasks are done, and creating a new one when we have updated all the demo stuff and are tracking new logs for the future release?

kojiromike avatar Nov 20 '25 16:11 kojiromike