Move the section visible logic to the format base class. This way format
plugins can decide whenever a section is visible or not instead of using
format custom settings from core.
The course index lock icon depends on the state hasrestrictions
attributes on both section and course module. The lock icon
should be consistent with the content availability information
and it was not. With this patch the hasrestrictions attribute
uses a similar logic than the course content.
Note that, instead of going one by one to them from the XMLDB Editor
(load, makes some tiny change, save, revert the change, save), the
report includes a commented line that, once uncommented, does regenerate
the file while reporting.
I've left it there as a commodity for the developer.
People uses to edit the install.xml files manually, here and there. That
uses to come with small mistakes, like wrong white-space indentation,
some attributes out of order...
While none of them are critical, they add a lot of noise when somebody
is correctly editing a file with the XMLDB Editor because it, correctly,
overwrites the whole file and then diffs show a lot of unrelated changes.
So, this report will inform us about any file needing to be regenerated
because it has been manually edited (in a different way than the way
the editor has).
Note that the report is very basic, with minimal ouput, manually
generating the HTML, like the rest of the XMLDB Editor actions do. We
are not using renderers neither templates here.
Also note that it includes a commented line of code that, once
uncommented, enables the report to, also, fix the wrong files. Useful
for developers.
Prior to this patch, the code was fetching all completion data for all
activities in a course, even when the activity was not requested. This
leads to recursion issues as the data has not been added to the cache
before this operation occurs.
To handle this situation, only the requested CM is fetched in full, and
a boolean flag is used to store whether the full data has been fetched.
When returning a partially fetched value from the cache, the flag is
used to determine whether more data must be fetched, and the cache
updated.
The flag is filtered out before the value is returned.
Note: Many of the tests were updated as these were inspecting private
features of the API which should not really be tested.