#7971 NORM 8.2.0 (: CP fails to validate all settings correctly
Zarro Boogs per Child
bugtracker at laptop.org
Thu Aug 14 18:28:06 EDT 2008
#7971: CP fails to validate all settings correctly
---------------------+------------------------------------------------------
Reporter: Eben | Owner: Eben
Type: defect | Status: new
Priority: normal | Milestone: 8.2.0 (was Update.2)
Component: sugar | Version: Development build as of this date
Keywords: 8.2.0:? | Next_action: code
Verified: 0 | Blockedby:
Blocking: |
---------------------+------------------------------------------------------
At present, the change handler for every setting independently validates
itself, and then is also responsible for updating the module-wide is_valid
property, to indicate whether or not all settings within it are currently
in a valid state.
There are 2 problems with this:
1. Every single change handler needs to be updated with a long
conditional (if a_is_valid and b_is_valid and c_is_valid...) in order to
update the global is_valid property, which causes code duplication and
makes adding additional settings a pain.
2. A number of modules actually fail to check a, b, c, etc. and instead
incorrectly set the global is_valid property based solely on whether or
not the just-changed setting is valid. Naturally, it's especially easy to
wind up with this type of error considering problem (1).
I have a patch for this which continues to allow each setting to set a
flag for its own validity, but which wraps the global check into a
_validate method, which should then be called from each change handler.
--
Ticket URL: <http://dev.laptop.org/ticket/7971>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list