Commit ce0d01b6 authored by Raph El's avatar Raph El

Hotfix Answers

parent 08e31db2
...@@ -65,7 +65,10 @@ class Answer{ ...@@ -65,7 +65,10 @@ class Answer{
public static function canEdit($ans, $form=null, $userId=null, $parent=null){ public static function canEdit($ans, $form=null, $userId=null, $parent=null){
if(ctype_xdigit($ans)){ if(ctype_xdigit($ans)){
$ans=self::getById($ans); $ans=self::getById($ans);
$form = Form::getByIdMongo($ans["form"]); if(!empty($ans["form"]))
$form = Form::getByIdMongo($ans["form"]);
else if(!empty($ans["formId"]))
$form = Form::getById($ans["formId"]);
//$parent = Slug::getElementBySlug($form["id"]); //$parent = Slug::getElementBySlug($form["id"]);
$userId=Yii::app()->session["userId"]; $userId=Yii::app()->session["userId"];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment