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

FIX: made invalid code shape error more user friendly #29498

Merged
merged 5 commits into from May 1, 2024

Conversation

YannisHoareau
Copy link
Contributor

When a barcode had an invalid shape, the page would die, now we use the error, catch it and send a pop up the the user so that he is told about what could have caused this error.

@@ -231,7 +231,7 @@
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
'photo'=>!empty($barcodeimage) ?? '' // Photo must be a file that exists with format supported by TCPDF
Copy link
Member

Choose a reason for hiding this comment

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

What !empty($barcodeimage) ?? '' means ?

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Apr 26, 2024
@YannisHoareau
Copy link
Contributor Author

YannisHoareau commented Apr 29, 2024

I changed this line (I changed it again because I made a mistake) because before, the barcode pdf would never be loaded because of an undefined variable. It was fixed in 18.0 version but not in 17.0. Also, my first fixing goal here was the not user friendly logic error when the barcode had an invalid shape (it was dying and throwing outside dolibarr app without saying what could have happened)

@eldy eldy merged commit 03c4f72 into Dolibarr:17.0 May 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants