X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fvalidations%2Fmedals.inc.php;h=dd58bbdc50d4dc6bb3b98a19488a5df2f69d5ab0;hb=a1ee34a40854bad35ee0663f17352ec51ab83365;hp=498ee493393924e8798a0627e1adcc32f446324b;hpb=de14933c384281bfc5571b8b3d7d7ac94b04bc48;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index 498ee49..dd58bbd 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; + } } // }}} @@ -101,10 +104,11 @@ class MedalReq extends Validate public function commit () { require_once 'notifs.inc.php'; - register_watch_op($this->user->id(), WATCH_FICHE, 'medals'); + 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); } // }}}