Closed (fixed)
Project:
Menu svg icons
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2017 at 18:26 UTC
Updated:
1 May 2018 at 08:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ziomizar commentedThis is a first approach to solve the problem that use simplexml_load_string to see if there is some errors.
This is compatible with the function menu_svg_icons_form_menu_link_content_form_alter that use also simplexml_load_string to access values directly (trusting the value stored in the backedn without validation).
Comment #3
ziomizar commentedComment #4
ziomizar commentedCan be tricky also understand why the dropdown is empty in case the symbol list is empty inside the tags.
This patch include an extra check that return errors when no symbols are found in the current implementation.
Not sure if is better search in the whole SVG directly in that way
$dom->symbolThat looks more flexible. But is not part of that issue.
Comment #5
s_leu commentedThis check seems obsolete as source is a required field in the form() method.
The comment should be "... iterate over errors generated by simplexml_load_string()".
Or what is $source_loaded referring to exactly?
The message should be "The value of source has to be a valid xml string."
Missing the full stop at the end of the comment.
Should be "Check if there are any valid 'symbol' tags inside the 'defs' tag."
Note the fullstop at the end of the sentence.
Comment #6
s_leu commentedAfter testing the patch I should add the following: In case libxml_get_errors() returns some errors, it would be helpful to iterate over those and print them as separate messages. This helps to fix the SVG code a lot in case it creates any problems and won't pass validation here.
Comment #7
ziomizar commented1. Removed the check.
2. This part has been refactored a bit after #6.
3. Changed as suggested.
4. and 5. full stopped.
Comment in #6 really make sense thanks.
Atm the error display line and column other than the message, but not sure how to format it to be more clear.
Comment #9
AndersNielsen commentedThank you for the effort. Pushed to dev
Comment #10
AndersNielsen commentedComment #11
AndersNielsen commented