You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a class called block_type, and when running the code checker, I received the following error message:
global $PAGE cannot be used in block classes. Use $this->page.
Steps to reproduce:
Create a block class (e.g., block_type).
Try using global $PAGE within the class.
Run the code checker.
Expected behavior:
The code checker should allow the use of global $PAGE in appropriate contexts or provide a clearer message on how to adjust the code.
Current behavior:
The checker throws an error suggesting the use of $this->page without adequately explaining the situations where this should be applied.
Environment:
Moodle version: 4.3
Local Code Checker version: 2024070500
Possible solution:
It would be helpful to review the checker's logic to recognize the context where global $PAGE might be necessary or to better document when $this->page should be used.
Thank you!
The text was updated successfully, but these errors were encountered:
I created a class called
block_type
, and when running the code checker, I received the following error message:Steps to reproduce:
block_type
).global $PAGE
within the class.Expected behavior:
The code checker should allow the use of
global $PAGE
in appropriate contexts or provide a clearer message on how to adjust the code.Current behavior:
The checker throws an error suggesting the use of
$this->page
without adequately explaining the situations where this should be applied.Environment:
Possible solution:
It would be helpful to review the checker's logic to recognize the context where
global $PAGE
might be necessary or to better document when$this->page
should be used.Thank you!
The text was updated successfully, but these errors were encountered: