From 7932938c741169c234586342fe01a0caf12b6b9d Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Thu, 13 Jun 2024 01:17:05 -0500 Subject: [PATCH] Internal: Fix forum visibility and notification issues - refs BT#21692 --- public/main/forum/forumfunction.inc.php | 6 +++--- public/main/inc/lib/api.lib.php | 4 +++- src/CourseBundle/Entity/CForum.php | 3 ++- src/CourseBundle/Entity/CForumCategory.php | 3 ++- src/CourseBundle/Entity/CForumThread.php | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/public/main/forum/forumfunction.inc.php b/public/main/forum/forumfunction.inc.php index 10763040027..f0f55f862df 100644 --- a/public/main/forum/forumfunction.inc.php +++ b/public/main/forum/forumfunction.inc.php @@ -1844,14 +1844,14 @@ function saveThread( ) { $message .= get_lang('Your message has to be approved before people can view it.').'
'; $message .= get_lang('You can now return to the'). - ' '. + ' '. get_lang('Forum').'
'; } else { $message .= get_lang('You can now return to the'). - ' '. + ' '. get_lang('Forum').'
'; $message .= get_lang('You can now return to the'). - ' '. + ' '. get_lang('Message').''; } $reply_info['new_post_id'] = $postId; diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index 2ad2f434aa3..05effc02431 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -2075,7 +2075,9 @@ function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '') if (!empty($url)) { $url .= '&gradebook='.(int) api_is_in_gradebook(); - $url .= '&origin='.$origin; + if (false !== $origin) { + $url .= '&origin=' . $origin; + } } return $url; diff --git a/src/CourseBundle/Entity/CForum.php b/src/CourseBundle/Entity/CForum.php index e99bf9d9210..dd39740efdf 100644 --- a/src/CourseBundle/Entity/CForum.php +++ b/src/CourseBundle/Entity/CForum.php @@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface; use Chamilo\CourseBundle\Repository\CForumRepository; use DateTime; use Doctrine\Common\Collections\ArrayCollection; @@ -21,7 +22,7 @@ */ #[ORM\Table(name: 'c_forum_forum')] #[ORM\Entity(repositoryClass: CForumRepository::class)] -class CForum extends AbstractResource implements ResourceInterface, Stringable +class CForum extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable { #[ORM\Column(name: 'iid', type: 'integer')] #[ORM\Id] diff --git a/src/CourseBundle/Entity/CForumCategory.php b/src/CourseBundle/Entity/CForumCategory.php index 23ac0047eb1..51ff4163a62 100644 --- a/src/CourseBundle/Entity/CForumCategory.php +++ b/src/CourseBundle/Entity/CForumCategory.php @@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface; use Chamilo\CourseBundle\Repository\CForumCategoryRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -18,7 +19,7 @@ #[ORM\Table(name: 'c_forum_category')] #[ORM\Entity(repositoryClass: CForumCategoryRepository::class)] -class CForumCategory extends AbstractResource implements ResourceInterface, Stringable +class CForumCategory extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable { #[ORM\Column(name: 'iid', type: 'integer')] #[ORM\Id] diff --git a/src/CourseBundle/Entity/CForumThread.php b/src/CourseBundle/Entity/CForumThread.php index ca42d581c01..03e93957176 100644 --- a/src/CourseBundle/Entity/CForumThread.php +++ b/src/CourseBundle/Entity/CForumThread.php @@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface; use Chamilo\CoreBundle\Entity\User; use Chamilo\CourseBundle\Repository\CForumThreadRepository; use DateTime; @@ -23,7 +24,7 @@ */ #[ORM\Table(name: 'c_forum_thread')] #[ORM\Entity(repositoryClass: CForumThreadRepository::class)] -class CForumThread extends AbstractResource implements ResourceInterface, Stringable +class CForumThread extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable { #[ORM\Column(name: 'iid', type: 'integer')] #[ORM\Id]