Uploaded image for project: '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
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.2
    • Component/s: Blocks, Tags
    • Labels:

      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

        Gliffy Diagrams

          Activity

          Hide
          skodak Petr Skoda added a comment -

          Thanks for the report.

          Show
          skodak Petr Skoda added a comment - Thanks for the report.
          Hide
          skodak Petr Skoda added a comment -

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

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

          Thanks for the report.

          Show
          skodak Petr Skoda added a comment - Thanks for the report.
          Hide
          poltawski Dan Poltawski added a comment -

          Integrated, thanks

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

          Works as described. Passing.

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

          YEAR!*

          CAF*, TOT!*

          • Your effort amazingly resulted. (unbelievable :-P)
          • Closing as fixed.
          • Tons of thanks.
          Show
          stronk7 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:
                Fix Release Date:
                10/Sep/12