I am following the included example (somewhat) for a simple login procedure, but I'm running into a problem; namely, the login page itself only takes the username and password as parameters, but when a $this->validate()->get() call is run, it returns a MySQL syntax error. The query shown is along these lines:
Quote:SELECT * FROM (`users`) WHERE `name` = 'Vinzent Zeppelin' AND `password` = '67174866a...etc' AND `other_field1` = AND `other_field2` =
The relationship between `user` and `other_field1` and `other_field2` is a bit unusual in that both fields are foreign keys pointing to a single column in another table; in other words, it's a "has two" relationship. The "other_field1" and "other_field2" are flagged as "required" in the validation rules (they are required when saving a user), and they also are foreign key attributes listed in the $has_one array of the user model (following the model in "Advanced Relationships" of the user guide). The problem is, it seems that DMZ automatically "validates" these relationships and includes them in the WHERE clause of the query even if they're empty, generating a broken query. Removing other_field1 and other_field2 from the $has_one array seemed to resolve the error; removing their "required" flags in the $validation array did not. Is there a workaround of some sort, or have I overlooked something?