File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
public/main/gradebook/lib/be Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,8 @@ public function add()
520
520
$ category = new GradebookCategory ();
521
521
$ category ->setTitle ($ this ->name );
522
522
$ category ->setDescription ($ this ->description );
523
+ $ userId = is_numeric ($ this ->user_id ) ? (int ) $ this ->user_id : api_get_user_id ();
524
+ $ category ->setUser (api_get_user_entity ($ userId ));
523
525
$ category ->setUser (api_get_user_entity ($ this ->user_id ));
524
526
$ category ->setCourse ($ course );
525
527
$ category ->setParent ($ parent );
@@ -613,7 +615,8 @@ public function save()
613
615
614
616
$ category ->setTitle ($ this ->name );
615
617
$ category ->setDescription ($ this ->description );
616
- $ category ->setUser (api_get_user_entity ($ this ->user_id ));
618
+ $ userId = is_numeric ($ this ->user_id ) ? (int ) $ this ->user_id : api_get_user_id ();
619
+ $ category ->setUser (api_get_user_entity ($ userId ));
617
620
$ category ->setCourse ($ course );
618
621
$ category ->setParent ($ parent );
619
622
$ category ->setWeight ($ this ->weight );
You can’t perform that action at this time.
0 commit comments