-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Warning Undefined array key "VALUE" in Option.php #1934
Conversation
Thanks for the PR. Though it lacks a test and more thorough explanation of what and how this should solve things. Please elaborate. The link is not enough, mainly because it shows an empty page, at least for me. |
Thanks for your feedback. Regarding the issue with the provided link, it is currently protected by credentials, making it inaccessible for a complete understanding. To enhance clarity and provide a more comprehensive view of the problem, I have included a screenshot that offers additional context and detailed insights into the issue. This screenshot serves as a valuable supplement to the link and will aid in a more thorough comprehension of the matter at hand. |
This does not provide any meaningful additional information at all. |
According to the function:
There is a condition checking if $attr['VALUE'] is set but while assigning $attr['VALUE'] to $this->mpdf->selectoption['currentVAL'] there is no. We could change it like this: $this->mpdf->selectoption['currentVAL'] = $attr['VALUE'] ?? null; instead of adding it inside the condition. The issue here is that we are trying to access an undefined array key VALUE |
Cool, now add a test to the PR with a code example that is affected by this fix. See test/Issues for examples. |
cba9110
to
d82b1a0
Compare
Missing Test added. |
This way of testing works, I guess, but I still would like a test to present an actual failing HTML snippet. |
37b36d3
to
311f280
Compare
Test with failing HTML snippet added too. The HTML code
contains an element without the 'value' attribute defined, and this specific structure is the direct cause of the error. This test should pass without applied correction.
I changed also this:
to
to support php version 5.x |
Great. Now that we know what HTML causes this, let's make this even more up to standard:
So, when the value attribute is not set, the textual value of the element should be used. Can we easilly set that instead of a default null? |
311f280
to
d94652a
Compare
Requested updates Done. With this, we are putting the textual value instead of null:
|
@finwe I'm waiting for your review to make sure every thing is now okay. |
Fixing an issue of the "Undefined array key "VALUE" notice in Option.php.
Link to the reported issue: https://app.glitchtip.com/evoludata/issues/2379545