From a1ee34a40854bad35ee0663f17352ec51ab83365 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 21 Feb 2009 09:23:20 +0100 Subject: [PATCH] Avoid null gids. Signed-off-by: Florent Bruneau --- core | 2 +- include/validations/medals.inc.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core b/core index adc69ce..e94c4a1 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit adc69ced9c75421c5ee596fbd0a3426fffb9940c +Subproject commit e94c4a1713cc0d63508a5d0ecd2d572f047975fb diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index a2a5dc1..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; + } } // }}} @@ -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); } // }}} -- 2.1.4