[Deprecated] DMZ 1.6.2 (DataMapper OverZealous Edition) |
[eluser]OverZealous[/eluser]
Well, that was easy. Assuming I didn't make any mistakes, I simply changed the replacement regex for subquery to only replace the tablename if it wasn't prefixed with _. Simply enough, and covers the common cases. Anyway, thanks (very much) to Cro_Crx for providing such a clear test case and making it so easy to track down! An updated release with this bugfix, the new language files, and other recent bugfixes is being prepped right now. It should be out in 20 minutes or so.
[eluser]OverZealous[/eluser]
Ok, the update is out. Version 1.6.2 contains bug fixes, the new language files, and a variety of minor updates to the manual. Quote:Download the Latest Version Here
[eluser]12vunion[/eluser]
I think I've found another bug. There is a problem with default values in validation/get rules. An empty string is being passed instead of a NULL when no param is set. This is stopping default values from being used. Code: var $validation = array(
[eluser]OverZealous[/eluser]
@12vunion That's not a bug - that's how it is designed. It mirrors the way validation rules work exactly. The end result is you cannot have default values on get_rules parameters, or you must explicitly check for the empty string and set the value.
[eluser]Michael Ditto[/eluser]
Require At Least My small contribution to the DMZ community, hope it's helpful for you. Example: Say you have a community website, and besides the regular contact information for a user, you want to have at least something on the user's profile page so that it's not a big sea of blankness. So you might create a model that looks like this: Code: class User extends DataMapper { Each of the validation elements 'about', 'favorite_quote', and 'fondest_memory' corresponds to a field in the database. But that last element is a non-field validation rule (think "Confirm Password" from the DMZ examples). Require At Least provides a rule that allows you to require that 'num_required' of the 'fields' you specify are filled in. If the minimum number is not met, an error will be set. In the case of the example above, the error would read, "You must supply at least one of the fields About You, Favorite Quote, or Fondest Memory." Download it here. I'll do my best to answer questions about it here if I can, but can't guarantee it as I'm about three deadlines behind already. :-)
[eluser]OverZealous[/eluser]
@michael Ditto Very slick. That's a great example of a validation extension. Don't forget you can (and should) require the extension this way: Code: class User extends DataMapper { This should work without issue, and keeps you from having to override the constructor unnecessarily.
[eluser]Michael Ditto[/eluser]
[quote author="OverZealous" date="1262075185"]@michael Ditto Very slick. That's a great example of a validation extension. Don't forget you can (and should) require the extension this way: Code: class User extends DataMapper { This should work without issue, and keeps you from having to override the constructor unnecessarily.[/quote] Ahh! Done. I completely missed that convention.
[eluser]Cro_Crx[/eluser]
[quote author="OverZealous" date="1262049238"]Anyway, thanks (very much) to Cro_Crx for providing such a clear test case and making it so easy to track down![/quote] Thanks for fixing it so quickly. I went to bed just after posting that, when I woke up this morning it was already fixed
[eluser]Cro_Crx[/eluser]
I've just downloaded the latest copy. Seems to be working well. Although up the top it's showing the wrong version in the comments: Code: * @version 1.6.1 ($Rev: 292 $) (Based on DataMapper 1.6.0)
[eluser]OverZealous[/eluser]
Doh! Thanks for catching that. Stupid complex update routine... Edit: OK, the download has the updated version number! |
Welcome Guest, Not a member yet? Register Sign In |