Open dcadiou opened 2 years ago
With modifications made on branch issue_5_warning, CI tests passed.
I just replaced $PAGE
with $this->Page
as asked. I suppos that $PAGE
is not accessible from within a block plugin.
I replaced the wrong reference to another plugin (probable a plugin name copied from another plugin and forgotten here) by the current one (as in the previous block of code in the same file).
I suppressed lines that performs this check, where it is indicated. As I understood, this check is supposed to prevent direct call of the php file from outside of the plugin. However, for all files that received this warning, the content is only defining functions or classes, and calling this from outside would not produce anything dangerous things, because a function alone does nothing if it isn't called. Idem for a class, defining a class won't do nothing if these class is not instanciated.
So these warning may indicates that in such situations (check + non dangerous code) performing this MOODLE_INTERNAL check is unuseful. Besides, other files in the plugin that also contains the check but contains instructions that performs something, such as affecting variable, did not received such warning (consequently I didn't suppressed anything in them).
Recent commits pushed has fail CI tests. Failures are not linked with recent changes, but seems to be rather old.
See, for instance, https://github.com/grp-attestoodle/moodle-block_attestoodle/actions/runs/3541794958/jobs/5946505639
Failures detected :