Skip to content

Commit

Permalink
fix Kunena configuration could not be stored
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Schultschik <[email protected]>
  • Loading branch information
svanschu committed Oct 7, 2024
1 parent 3338e52 commit 11d8288
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
11 changes: 2 additions & 9 deletions src/libraries/kunena/src/Config/KunenaConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -1819,16 +1819,9 @@ public function getEmail(): string
*/
public function set($property, $value): bool
{
// type checking?
if (property_exists('KunenaConfig', $property)) {
if (strcmp(\gettype($this->$property), \gettype($value)) == 0) {
$this->$property = $value;
$this->$property = $value;

return true;
}
}

return false;
return true;
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/libraries/kunena/src/Route/KunenaRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,18 +995,18 @@ public static function fixMissingItemID(): int
}

/**
* @param KunenaTopic $topic topic
* @param bool $xhtml xhtml
* @param KunenaMessage|string|null $action actions
* @param KunenaCategory|null $category category
* @param int $itemid itemid
* @param KunenaTopic $topic topic
* @param bool $xhtml xhtml
* @param ?KunenaMessage|string $action actions
* @param ?KunenaCategory $category category
* @param int $itemid itemid
*
* @return boolean
*
* @since Kunena 6.0
* @throws Exception
*/
public static function getTopicUrl(KunenaTopic $topic, bool $xhtml = true, $action = null, KunenaCategory $category = null, $Itemid = 0)
public static function getTopicUrl(KunenaTopic $topic, bool $xhtml = true, $action = null, ?KunenaCategory $category = null, $Itemid = 0)
{
if (!$category) {
$category = $topic->getCategory();
Expand All @@ -1018,15 +1018,15 @@ public static function getTopicUrl(KunenaTopic $topic, bool $xhtml = true, $acti
/**
* @param KunenaMessage $message message
* @param bool $xhtml xhtml
* @param KunenaTopic $topic topic
* @param KunenaCategory $category category
* @param ?KunenaTopic $topic topic
* @param ?KunenaCategory $category category
*
* @return boolean
*
* @since Kunena 6.0
* @throws Exception
*/
public static function getMessageUrl(KunenaMessage $message, $xhtml = true, ?KunenaTopic $topic, ?KunenaCategory $category)
public static function getMessageUrl(KunenaMessage $message, $xhtml = true, ?KunenaTopic $topic = null, ?KunenaCategory $category = null)
{
// FIXME: not yet fully implemented...
if (!$category) {
Expand Down

0 comments on commit 11d8288

Please sign in to comment.