Postponed
Project:
Patterns
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2009 at 21:39 UTC
Updated:
12 Jan 2009 at 17:10 UTC
I've been playing around with the newest 6.x version, and I'm liking the XML Validation that prevents the edited file from being re-saved until it's correct. However, there's something missing. A line number of the error would be helpful. Could we add a patterns_xml_validator() func?
patterns_edit_submit() could call patterns_xml_validator() function just prior to the patterns_save_pattern() on line 505. The validation function should parse all of the submitted XML for 'properness', and upon failure call a theme function that returns the line number of the first encountered error.
What say you? Does this idea play well into the abstracted configuration platform?
Comments
Comment #1
senpai commentedLine 283 of patterns.module has a TODO that plays nicely into this idea as well. Just FYI.
Comment #2
vaish commentedThis seems like something we would want to leave for the next phase when we separate patterns module and configuration framework. There is going to be a lot of major changes to the code and improving and centralizing* XML validation fits well into that picture.
*validation needs to be done on list, import and edit operations
Comment #3
senpai commented"validation needs to be done on list, import and edit operations"
Agreed. At the point in which the code becomes two modules, that's when this validation step should happen. Doing it now looks like it'll shoehorn a lot of cruft into the code in places it doesn't belong.