Eye form error, v6.1.0

Hi Brady, I have this error when I want to work on the EyeExam, it happens exclusively to patients who have previous EyeExam, what should I do?

Fatal error : Uncaught Error: Undefined constant “id” in /homepages/26/d793096920/htdocs/openemr/interface/forms/eye_mag/php/eye_mag_functions.php:157 Stack trace: #0 /homepages/26/d793096920/htdocs/openemr/interface/forms/eye_mag/view.php(237): priors_select(‘ALL’, ‘2787’, ‘2787’, ‘50’) #1 /homepages/26/d793096920/htdocs/openemr/interface/patient_file/encounter/view_form.php(26): include_once(’/homepages/26/d…’) #2 {main} thrown in /homepages/26/d793096920/htdocs/openemr/interface/forms/eye_mag/php/eye_mag_functions.php on line 157

I have noticed that you have a similar problem in the demo of your website.

hi @jl1dvg1 , thanks for the bug report, can you edit this file with the changes noted there and report back if you’re able to use the form please?

thank you very much solved

now i have this error when printing an LBF form

Fatal error : Uncaught TypeError: Unsupported operand types: string + float in /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php:6519 Stack trace: #0 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(15952): Mpdf\Mpdf->finishFlowingBlock(true) #1 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Tag/BlockTag.php(233): Mpdf\Mpdf->printbuffer(Array, 0) #2 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Tag.php(240): Mpdf\Tag\BlockTag->open(Array, Array, 1) #3 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(13812): Mpdf\Tag->OpenTag(‘DIV’, Array, Array, 1) #4 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9715): Mpdf\Mpdf->WriteHTML(’ <div style="te…’, 4) #5 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9945): Mpdf\Mpdf->_puthtmlheaders() #6 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(2048): Mpdf\Mpdf->_enddoc() #7 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9484): Mpdf\Mpdf->Close() #8 /homepages/26/d793096920/htdocs/openemr/interface/forms/LBF/printable.php(634): Mpdf\Mpdf->Output(‘form.pdf’, ‘I’) #9 {main} thrown in /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php on line 6519

It seems that in the demo you have the same error

Jorge

hi @jl1dvg1 , should find this on line 6519 of vendor/mpdf/mpdf/src/Mpdf.php

 $usey = $this->y + 0.002;

replace with

$usey = floatval($this->y) + 0.002;

what php version is listed under Admin->System->Diagnostics?

the same one you have in the demo
PHP version 8.0.16
I made the change you suggested and now I have another error, on your demo page it doesn’t work either

Fatal error : Uncaught TypeError: Unsupported operand types: string + int in /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php:6633 Stack trace: #0 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(15952): Mpdf\Mpdf->finishFlowingBlock(true) #1 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Tag/BlockTag.php(233): Mpdf\Mpdf->printbuffer(Array, 0) #2 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Tag.php(240): Mpdf\Tag\BlockTag->open(Array, Array, 1) #3 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(13812): Mpdf\Tag->OpenTag(‘DIV’, Array, Array, 1) #4 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9715): Mpdf\Mpdf->WriteHTML(’ <div style="te…’, 4) #5 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9945): Mpdf\Mpdf->_puthtmlheaders() #6 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(2048): Mpdf\Mpdf->_enddoc() #7 /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php(9484): Mpdf\Mpdf->Close() #8 /homepages/26/d793096920/htdocs/openemr/interface/forms/LBF/printable.php(634): Mpdf\Mpdf->Output(‘form.pdf’, ‘I’) #9 {main} thrown in /homepages/26/d793096920/htdocs/openemr/vendor/mpdf/mpdf/src/Mpdf.php on line 6633

add the same change as prior to line 6633

I think we have to revert the recent version bump for Mpdf. This isn’t something we can maintain in releases because a new build will just over write.

I made the change in line 6633 and 6720

now i have this problem

Fatal error : Uncaught TypeError: Unsupported operand types: int + string in /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Tag/BlockTag.php:1049 Stack trace: #0 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Tag.php(247): Mpdf\Tag\BlockTag->close(Array, 3) #1 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Mpdf.php(13718): Mpdf\Tag->CloseTag(‘DIV’, Array, 3) #2 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Mpdf.php(9715): Mpdf\Mpdf->WriteHTML(’ <div style="te…’, 4) #3 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Mpdf.php(9945): Mpdf\Mpdf->_puthtmlheaders() #4 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Mpdf.php(2048): Mpdf\Mpdf->_enddoc() #5 /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Mpdf.php(9484): Mpdf\Mpdf->Close() #6 /homepages/26/d793096920/htdocs/saludvisual/interface/forms/LBF/printable.php(634): Mpdf\Mpdf->Output(‘form.pdf’, ‘I’) #7 {main} thrown in /homepages/26/d793096920/htdocs/saludvisual/vendor/mpdf/mpdf/src/Tag/BlockTag.php on line 1049

I dont know

@sjpadgett , @stephenwaite , @jl1dvg1
Initial testing is showing that the mPDF SetHTMLHeader and SetHTMLFooter functions are breaking like this, which is only used in the LBF mPDF code. Guessing this is a php version thing and not a mPDF version thing (ie. reverting back to earlier mPDF version likely won’t fix this, although I have not tried that). If I comment out both the SetHTMLHeader and SetHTMLFooter calls in interface/forms/LBF/printable.php, then it works (but of course is then missing the header and footers).

Got it fixed. Try this code and let me know if that fixes your issue:
fix for print LBF form

1 Like

thanks Brady the problem was temporarily solved

hi @jl1dvg1 , can you weigh in on Brady’s question on the other option to fix this posted here please?

so the code there would look like

'margin_top' => $GLOBALS['pdf_top_margin'],
'margin_bottom' => $GLOBALS['pdf_bottom_margin'],
'margin_header' => 0,
'margin_footer' => 0,

sorry, not urgent, was meant mainly for @sjpadgett, lbf wizard

The EyeExam form works fine if it is created for the first time, if an EyeExam has been created in a previous encounter the EyeExam form does not load in any encounter

This error also exists in the DEMO of the web page