X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fmedals.inc.php;h=e448358fb5febace8403c9c58f38ca598065ce85;hb=ecad8a08350703f181e1e11b822d1faf381fb51f;hp=0bc892c6468909c8d087b1df72f484617d2a3ae8;hpb=af744c2d5f4ddf83b738b9cb390926eaca4cf7c3;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index 0bc892c..e448358 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -36,6 +36,9 @@ class MedalReq extends Validate parent::__construct($_user, false, 'medal', $_stamp); $this->mid = $_idmedal; $this->gid = $_subidmedal; + if (is_null($this->gid)) { + $this->gid = 0; + } } // }}} @@ -104,7 +107,8 @@ class MedalReq extends Validate register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals'); return XDB::execute('REPLACE INTO profile_medals_sub VALUES ({?}, {?}, {?})', - $this->user->id(), $this->mid, $this->gid); + $this->user->id(), $this->mid, + is_null($this->gid) ? 0 : $this->gid); } // }}}