Skip to content

Commit

Permalink
Convert the guest_url ORM validation failure back to the url form
Browse files Browse the repository at this point in the history
parameter and put in a message requiring a valid url.  Fixes ticket
  • Loading branch information
bharat committed Sep 16, 2010
1 parent 70f15c6 commit 3e30989
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/comment/controllers/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function create($id) {
switch ($key) {
case "guest_name": $key = "name"; break;
case "guest_email": $key = "email"; break;
case "guest_url": $key = "url"; break;
}
$form->add_comment->inputs[$key]->add_error($error, 1);
}
Expand Down
3 changes: 2 additions & 1 deletion modules/comment/helpers/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ static function get_add_form($item) {
->error_messages("invalid", t("You must enter a valid email address"));
$group->input("url")
->label(t("Website (hidden)"))
->id("g-url");
->id("g-url")
->error_messages("url", t("You must enter a valid url"));
$group->textarea("text")
->label(t("Comment"))
->id("g-text")
Expand Down

0 comments on commit 3e30989

Please sign in to comment.