Moodle

output components can not use globals $PAGE and $OUTPUT

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

if something needs $OUTPUT or $PAGE it has to be moved to the page renderer or refactored so that instead of globals the renderer is passed into the function

in any case this needs a lot of review + refactoring + tons of improvements because it is not designed in the best way

Activity

Hide
Petr Škoda (skodak) added a comment -

done

Show
Petr Škoda (skodak) added a comment - done
Hide
Tim Hunt added a comment -

Brilliant! Obvious improvement. Thank you for noticing and fixing the problem.

Show
Tim Hunt added a comment - Brilliant! Obvious improvement. Thank you for noticing and fixing the problem.
Hide
Gabriel Dias added a comment -

Just a little thing. In the file lib/outputcomponents.php clas html_select and function make_popup_form there is a duplicated piece of code:

if (!($baseurl instanceof moodle_url)) { $baseurl = new moodle_url($baseurl); }

You have to delete the second one.

Don't know if this is the best way to inform such a little thing

Show
Gabriel Dias added a comment - Just a little thing. In the file lib/outputcomponents.php clas html_select and function make_popup_form there is a duplicated piece of code: if (!($baseurl instanceof moodle_url)) { $baseurl = new moodle_url($baseurl); } You have to delete the second one. Don't know if this is the best way to inform such a little thing
Hide
Petr Škoda (skodak) added a comment -

Hi Gabriel,
I am going through this code area right now and fixing many issues like this one, I think the code will be ready for more reviews and final testing in about a week.

In any case thanks for your reports

Show
Petr Škoda (skodak) added a comment - Hi Gabriel, I am going through this code area right now and fixing many issues like this one, I think the code will be ready for more reviews and final testing in about a week. In any case thanks for your reports

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: