- Issue created by @frouco
- Merge request !10Issue #3442238: Undefined array keys error when using the ExIcon widget → (Closed) created by frouco
- Status changed to Needs work
over 1 year ago 10:57am 20 April 2024 - 🇬🇧United Kingdom Wongjn
Hi! Thank you for your report and contribution!
Can I just double-check you are running
8.x-1.7? It seems dubious that the error message is reportingline 88when that is outside thetemplate_preprocess_ex_icon()function. Furthermore, we doisset()checks on lines 72–74:if (isset($variables['attributes']['width']) xor isset($variables['attributes']['height'])) { $numeric_width = isset($variables['attributes']['width']) && is_numeric($variables['attributes']['width']); $numeric_height = isset($variables['attributes']['height']) && is_numeric($variables['attributes']['height']);So the error shouldn't ever come up.
Indeed, even in the PHPUnit tests for
8.x-1.7, no such error is surfaced.With these two points, I am leaning towards something within your setup specifically. However, if you could provide anymore details to replicate the problem and/or a PHPUnit test to go alongside your MR, that would be most helpful.
- 🇪🇸Spain frouco
Hi Wongjn
Yes, Im running 8.x-1.7?
The issue comes from how are generated the options of the widget, width and height are not set. So the the condition of the
line 88fo thetemplate_preprocess_ex_icon()don't apply.The issue can be solved there enforcing the detected size if boot values are empty but i feel that is better set the options of the icons selector correctly. Setting the width and height here and apply them here
- 🇬🇧United Kingdom Wongjn
The issue comes from how are generated the options of the widget, width and height are not set. So the the condition of the
line 88in thetemplate_preprocess_ex_icon()don't apply.Could I check what the condition on
line 88is please? From what I can see, that line is outside thetemplate_preprocess_ex_icon()function and is a line of the documentation block, unless I am mistaking what the line number is referring to.I'd prefer we get to the root of the cause of the warning in
template_preprocess_ex_icon()rather than rework render arrays. This is because any code that uses theex_icon#themecould cause this warning if they don't passwidthandheight#attributes, so I'd like to fix it at the "origin" point, so to speak. - Issue was unassigned.
- Status changed to Closed: works as designed
over 1 year ago 1:02pm 20 April 2024 - 🇪🇸Spain frouco
aggg, my mistake
I did not realise before that I had applied a patch ✨ Allow inline SVG instead of tag Active to the module in the website I was testing.
Sorry for the noise. I close the MR and this task. Module works correctly