Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.3, 2.5
    • Fix Version/s: 2.4.5, 2.5.1
    • Component/s: Reports
    • Labels:
    • Rank:
      48560

      Description

      When visiting Home ► My profile settings ► Activity reports ► Today's logs the graph is not displayed and the PHP error log tells about it:

      PHP Strict Standards:  Creating default object from empty value
      in /path/to/report/log/graph.php on line 194
      

        Activity

        Hide
        Matteo Scaramuccia added a comment -

        The fix is quite simple:

        diff --git a/report/log/graph.php b/report/log/graph.php
        index 842f847..58a49cb 100644
        --- a/report/log/graph.php
        +++ b/report/log/graph.php
        @@ -130,6 +130,7 @@ if ($type === "usercourse.png") {
        
            $graph = new graph(750, 400);
        
        +   $a = new stdClass();
            $a->coursename = format_string($course->shortname, true, array('context' => $coursecontext));
            $a->username = fullname($user, true);
            $graph->parameter['title'] = get_string("hitsoncourse", "", $a);
        @@ -191,6 +192,7 @@ if ($type === "usercourse.png") {
        
            $graph = new graph(750, 400);
        
        +   $a = new stdClass();
            $a->coursename = format_string($course->shortname, true, array('context' => $coursecontext));
            $a->username = fullname($user, true);
            $graph->parameter['title'] = get_string("hitsoncoursetoday", "", $a);
        

        I'm wondering if this could be an error pattern: I'll search for it.

        Show
        Matteo Scaramuccia added a comment - The fix is quite simple: diff --git a/report/log/graph.php b/report/log/graph.php index 842f847..58a49cb 100644 --- a/report/log/graph.php +++ b/report/log/graph.php @@ -130,6 +130,7 @@ if ($type === "usercourse.png") { $graph = new graph(750, 400); + $a = new stdClass(); $a->coursename = format_string($course->shortname, true, array('context' => $coursecontext)); $a->username = fullname($user, true); $graph->parameter['title'] = get_string("hitsoncourse", "", $a); @@ -191,6 +192,7 @@ if ($type === "usercourse.png") { $graph = new graph(750, 400); + $a = new stdClass(); $a->coursename = format_string($course->shortname, true, array('context' => $coursecontext)); $a->username = fullname($user, true); $graph->parameter['title'] = get_string("hitsoncoursetoday", "", $a); I'm wondering if this could be an error pattern: I'll search for it.
        Hide
        Michael de Raadt added a comment -

        I noticed this warning appearing in 2.4 and master, so it's not a new issue.

        Show
        Michael de Raadt added a comment - I noticed this warning appearing in 2.4 and master, so it's not a new issue.
        Hide
        Petr Škoda added a comment -

        +1

        Show
        Petr Škoda added a comment - +1
        Hide
        Matteo Scaramuccia added a comment -

        Hi Eloy,
        would you like me to rebase it and to add the new missing 2.5 branch? I've planned to do that this night or the next but maybe it could be too late for your schedule.

        Matteo

        Show
        Matteo Scaramuccia added a comment - Hi Eloy, would you like me to rebase it and to add the new missing 2.5 branch? I've planned to do that this night or the next but maybe it could be too late for your schedule. Matteo
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated (24, 25 and master), thanks!

        Thanks Matteo, I've cherry-picked it, np.

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated (24, 25 and master), thanks! Thanks Matteo, I've cherry-picked it, np.
        Hide
        Rossiani Wijaya added a comment -

        This is working as expected.

        Tested for 2.4, 2.5 and master.

        Test passed.

        Show
        Rossiani Wijaya added a comment - This is working as expected. Tested for 2.4, 2.5 and master. Test passed.
        Hide
        Dan Poltawski added a comment -
        Feature: Thanks to our superb contributors
          In order to make Moodle better
          As an integrator
          I need to thank all our contributors
        
          Scenario: Dan thanks you all
            Given I log in as "dan"
            And I see "lots of fixed issues"
            When I follow "Close integrated issues"
            Then I should see "Lots of thanks to all our contributors"
        

        Your changes are upstream

        Show
        Dan Poltawski added a comment - Feature: Thanks to our superb contributors In order to make Moodle better As an integrator I need to thank all our contributors Scenario: Dan thanks you all Given I log in as "dan" And I see "lots of fixed issues" When I follow "Close integrated issues" Then I should see "Lots of thanks to all our contributors" Your changes are upstream

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: