Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44167

dock variable region is not defined

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.6.1
    • None
    • Blocks, JavaScript
    • MOODLE_26_STABLE

    Description

      If you use $OUTPUT->blocks and dock is enabled, you will get javascript error: variable region is not defined.
      Problem files are located in /lib/yui/build/moodle-core-dock folder.

      Current code in these files causes an error:

      Y.all(SELECTOR.blockregion).each(function(){
                  var regionname = region.getData('blockregion');
                  if (region.all('.block').size() > 0) {
                      populatedblockregions++;
                      BODY.addClass('used-region-'+regionname);
                      BODY.removeClass('empty-region-'+regionname);
                  } else {
                      BODY.addClass('empty-region-'+regionname);
                      BODY.removeClass('used-region-'+regionname);
                  }
              });
      

      We fix this bug by adding param 'region' into the function params:

      Y.all(SELECTOR.blockregion).each(function(region){
                  var regionname = region.getData('blockregion');
                  if (region.all('.block').size() > 0) {
                      populatedblockregions++;
                      BODY.addClass('used-region-'+regionname);
                      BODY.removeClass('empty-region-'+regionname);
                  } else {
                      BODY.addClass('empty-region-'+regionname);
                      BODY.removeClass('used-region-'+regionname);
                  }
              });
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stanislavsh Stanislav Shultsov
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: