projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid null gids.
[platal.git]
/
include
/
validations
/
medals.inc.php
diff --git
a/include/validations/medals.inc.php
b/include/validations/medals.inc.php
index
498ee49
..
dd58bbd
100644
(file)
--- 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;
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';
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 ({?}, {?}, {?})',
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);
}
// }}}
}
// }}}