Moodle
  1. Moodle
  2. MDL-31167 PHP strict META
  3. MDL-34873

Strict standard error on tags block and when editing tags

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.2
    • Component/s: Blocks, Tags
    • Labels:
    • Rank:
      43396

      Description

      An error message is displayed when you disable tags on site level and add a tags block to a course index page.

      Strict Standards: Creating default object from empty value in /var/www/stable/master/moodle/blocks/tags/block_tags.php on line 43 
      

      This seems to solve the issue...

      --- a/blocks/tags/block_tags.php
      +++ b/blocks/tags/block_tags.php
      @@ -40,6 +40,7 @@ class block_tags extends block_base {
               global $CFG, $COURSE, $SITE, $USER, $SCRIPT, $OUTPUT;
       
               if (empty($CFG->usetags)) {
      +            $this->content = new stdClass();
                   $this->content->text = '';
                   if ($this->page->user_is_editing()) {
                       $this->content->text = get_string('disabledtags', 'block_tags');
      

      Reproduction steps:

      1. Log in as admin
      2. Navigate to Settings > Site admin > Development > Debugging
      3. Set debugging to the highest level
      4. Navigate to Settings > Site admin > Advanced features
      5. Disable tags on site level
      6. Navigate to a course
      7. Add a tags block to a course index page

        Activity

        Hide
        Petr Škoda added a comment -

        Thanks for the report.

        Show
        Petr Škoda added a comment - Thanks for the report.
        Hide
        Petr Škoda added a comment -

        There are also multiple E-STRICT problems when editing tags, I am going to fix them at the same time.

        Show
        Petr Škoda added a comment - There are also multiple E-STRICT problems when editing tags, I am going to fix them at the same time.
        Hide
        Petr Škoda added a comment -

        Thanks for the report.

        Show
        Petr Škoda added a comment - Thanks for the report.
        Hide
        Dan Poltawski added a comment -

        Integrated, thanks

        Show
        Dan Poltawski added a comment - Integrated, thanks
        Hide
        Andrew Davis added a comment -

        Works as described. Passing.

        Show
        Andrew Davis added a comment - Works as described. Passing.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        YEAR!*

        CAF*, TOT!*

        • Your effort amazingly resulted. (unbelievable :-P)
        • Closing as fixed.
        • Tons of thanks.
        Show
        Eloy Lafuente (stronk7) added a comment - YEAR!* CAF*, TOT!* Your effort amazingly resulted. (unbelievable :-P) Closing as fixed. Tons of thanks.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: