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

dock variable region is not defined

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.6.1
    • Fix Version/s: None
    • Component/s: Blocks, JavaScript
    • Labels:
    • Affected Branches:
      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

              Assignee:
              Unassigned Unassigned
              Reporter:
              stanislavsh Stanislav Shultsov
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: