X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fvalidations%2Fmedals.inc.php;h=4a2f6a9ba1b1d70d26d05d14080b35201acf3c73;hb=100e66fc8ab2b48621b287d50079558d83187278;hp=498ee493393924e8798a0627e1adcc32f446324b;hpb=532c06cf78d430c5278df7006335df2921fa98d4;p=platal.git diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index 498ee49..4a2f6a9 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -1,6 +1,6 @@ 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); } // }}}