From 22d45e772a36dc78e9306c7b1a9ffae59937efbf Mon Sep 17 00:00:00 2001 From: lub Date: Wed, 28 Aug 2019 11:46:00 +0200 Subject: [PATCH] fix icon inheritance --- functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 259ab42..5d33ce6 100644 --- a/functions.php +++ b/functions.php @@ -6,8 +6,12 @@ function createChannel($server, $name, $parent, $options) { 'cpid' => $parent->getId() )); if($options['inherit_icons']) { - $channel = $server->channelGetById($id); - $channel->modify(array('channel_icon_id' => $parent->getProperty('channel_icon_id'))); + $icon = $parent->getProperty('channel_icon_id'); + + #check if parent channel actually has an icon + if($icon !== 0) { + $server->channelPermAssign($id, "i_icon_id", $icon); + } } }