Project

General

Profile

Bug #6572

when unsubscribing from topic: fatal error

Added by Anonymous almost 7 years ago. Updated almost 7 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Start date:
16/08/2013
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal

Description


Fatal error: Call to a member function delete() on a non-object in /home/kmoerman/Code/chamilo-dev/repository/content_object/forum/php/lib/complex_display/component/topic_unsubscribe.class.php on line 27

Call Stack:
    0.0002     676688   1. {main}() /home/kmoerman/Code/chamilo-dev/index.php:0
    0.1917   17388472   2. common\libraries\Application::launch() /home/kmoerman/Code/chamilo-dev/index.php:87
    0.1971   18674312   3. application\weblcms\WeblcmsManagerCourseViewerComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/application.class.php:777
    0.2913   23100600   4. application\weblcms\Tool::factory_and_launch() /home/kmoerman/Code/chamilo-dev/application/weblcms/php/lib/weblcms_manager/component/course_viewer.class.php:122
    0.2918   23179792   5. common\libraries\SubManager::launch() /home/kmoerman/Code/chamilo-dev/application/weblcms/php/lib/tool/tool.class.php:154
    0.2962   23925664   6. application\weblcms\tool\forum\ForumToolViewerComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/sub_manager.class.php:340
    0.3189   27635000   7. repository\ComplexDisplay::launch() /home/kmoerman/Code/chamilo-dev/application/weblcms/tool/forum/php/lib/component/viewer.class.php:59
    0.3192   27716720   8. repository\ComplexDisplay::launch() /home/kmoerman/Code/chamilo-dev/repository/php/lib/complex_display/complex_display.class.php:115
    0.3192   27717064   9. common\libraries\SubManager::launch() /home/kmoerman/Code/chamilo-dev/repository/php/lib/complex_display/complex_display.class.php:110
    0.3287   28301112  10. repository\content_object\forum\ForumComplexDisplayTopicUnsubscribeComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/sub_manager.class.php:340

History

#1

Updated by Nathalie Blocry almost 7 years ago

  • Target version set to LCMS 4 Beta
#2

Updated by Anonymous almost 7 years ago

partial resolve:
success/failure status was wrongly deduced. The fatal error has been removed, but unsubscribing remains unsuccessful

if($subscribe_id)
{
    $subscribe = ForumTopicDataManager :: retrieve_subscribe($subscribe_id, null);
    $success = $subscribe && $subscribe->delete();
}

$message = Translation :: get($success ? 'SuccesUnsubscribe' : 'UnSuccesUnSubscribe', null, ContentObject :: get_content_object_type_namespace('forum_topic'));
#3

Updated by Anonymous almost 7 years ago

similar error when unsubscribing from complete forum:

Fatal error: Call to a member function delete() on a non-object in /home/kmoerman/Code/chamilo-dev/application/weblcms/tool/forum/php/lib/component/forum_unsubscribe.class.php on line 47

Call Stack:
    0.0003     674944   1. {main}() /home/kmoerman/Code/chamilo-dev/index.php:0
    0.2436   17396784   2. common\libraries\Application::launch() /home/kmoerman/Code/chamilo-dev/index.php:87
    0.2501   18674672   3. application\weblcms\WeblcmsManagerCourseViewerComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/application.class.php:777
    0.4101   23101240   4. application\weblcms\Tool::factory_and_launch() /home/kmoerman/Code/chamilo-dev/application/weblcms/php/lib/weblcms_manager/component/course_viewer.class.php:122
    0.4107   23180432   5. common\libraries\SubManager::launch() /home/kmoerman/Code/chamilo-dev/application/weblcms/php/lib/tool/tool.class.php:154
    0.4149   23674248   6. application\weblcms\tool\forum\ForumToolForumUnsubscribeComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/sub_manager.class.php:340

I applied the same partial solution as with the topic unsubscriber.

#4

Updated by Anonymous almost 7 years ago

  • Status changed from New to Bug resolved

resolved: it turned out the links were incorrectly formed:

forum unsubscribe
file application/weblcms/tool/forum/php/lib/component/browser.class.php line 749
changed $subscribed->get_id() to $forum->get_id()

changed file repository/content_object/forum/php/lib/complex_display/component/forum_viewer.class.php line 505
changed $subscribed->get_id() to $topic->get_ref()->get_id()

Also available in: Atom PDF