Monday 18 July 2011 12:56:14 pm
We've been using datatypes' fromString methods for years now, for imports and updates. The "ezuser" datatype's fromString method does a check to make sure that the username and e-mail address don't already exist (see here for a bit of context: http://issues.ez.no/IssueView.php?Id=17836&activeItem=3). This makes it unsuitable to be used for updates to existing users. We use some simple workaround code to capture updates to "ezuser" attributes and update them directly -- not really a problem. However, this brings up a general framework question: Was the intention around fromString for it to be used on new object creation only? If it was also intended to be used in updates, then perhaps ezuser's fromString method should be modified to put the onus on the script using that method to do its own checks on the username or e-mail address. This way, the actual update process is more standardized: you are forced to do all of the necessary preparation on the attributes before they are passed through.
http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada
|