next up previous contents
Next: 問題二 Up: 問題解決 Previous: 問題解決   Contents

問題一

  1. bug1
        / ► 網站管理
        / ► 報表
        / ► 回應
    Invalid component used in plugin/component_callback():mod_
    
  2. answer1
    commit 6a3984fe0f94914cb4c3a1e6f809d520341a6797
    Author: Chris Wharton <chrisw@catalyst.net.nz>
    Date:   Fri Aug 3 13:38:23 2012 +1200
    
        comment/locallib.php: Fix broken comments report
        
        WR96765: Workaround for issue MDL-31010
        Signed-off-by: Chris Wharton <chrisw@catalyst.net.nz>
    
    diff --git a/comment/locallib.php b/comment/locallib.php
    index fd62b61..079bf00 100644
    --- a/comment/locallib.php
    +++ b/comment/locallib.php
    @@ -127,6 +127,10 @@ class comment_manager {
                     $this->cm = get_coursemodule_from_id('', $this->context->instanceid);
                     $this->setup_course($this->cm->course);
                     $this->modinfo = get_fast_modinfo($this->course);
    +                if (!isset($this->modinfo->cms[$this->cm->id]->modname)) {
    +                    $this->pluginname = $this->cm->modname;
    +                    break;
    +                }
                     $this->pluginname = $this->modinfo->cms[$this->cm->id]->modname;
                     break;
             }
    



2018-08-14