PHP 7 Clean up Controller Class

juggernautsei wrote on Tuesday, November 08, 2016:

Have been working on cleaning up some PHP errors that we are getting on a php 7, windows 2012 server. Attached is the list of errors that were present.

There are more. We’ll keep working them down. There are a lot of Undefined index errors being thrown.

juggernautsei wrote on Wednesday, November 09, 2016:

There are a lot of errors that have been worked on. However there are a lot of these left

Only variables should be assigned by reference in C:\emr_wamp\www\openemr\library\appointments.inc.php on line 137

PHP Notice: Undefined offset: 0 in C:\emr_wamp\www\openemr\library\classes\X12Partner.class.php on line 40

Has anyone seen these errors on linux install?

juggernautsei wrote on Monday, November 14, 2016:

So I removed the [0] and there were no additional errors thrown nor did the program stop working.

bradymiller wrote on Monday, November 14, 2016:

Hi,

The error notice likely arises when the returned value from _load_enum(“processing_format”,false); is an empty array. So would need to ensure the array is not empty before trying to access [0] of it.

For now, suggest turning off php notices and focusing on the php warning and php deprecated for now(most of these have been dealt with, but still some left). Then when those are done, could then attack notices (of which there are a huge number of).

-brady
OpenEMR