This change:
- Moves the API to use the `before_file_created` hook
- Remove the newly created `$notify` param for `after_file_created` hook
- Stop persisting redactable content
- Update manager to not deal with `stored_file` instances
- Correct namespace from `\core\filereact` to `\core_files\redactor`
- Add `redactor` as a valid L2 namespace within the `core_files` API
- Correct config setting names
- Adds missing unit tests
- Disables the service for PHPUnit tests
AMOS BEGIN
MOV [fileredact,core_files],[redactor,core_files]
MOV [fileredact,core_files],[redactor:exifremover,core_files]
MOV [fileredact,core_files],[redactor:exifremover:emptyremovetags,core_files]
MOV [fileredact,core_files],[redactor:exifremover:enabled,core_files]
MOV [fileredact,core_files],[redactor:exifremover:enabled_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:failedprocessexiftool,core_files]
MOV [fileredact,core_files],[redactor:exifremover:failedprocessgd,core_files]
MOV [fileredact,core_files],[redactor:exifremover:heading,core_files]
MOV [fileredact,core_files],[redactor:exifremover:mimetype,core_files]
MOV [fileredact,core_files],[redactor:exifremover:mimetype_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:removetags,core_files]
MOV [fileredact,core_files],[redactor:exifremover:removetags_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tag:all,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tag:gps,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tooldoesnotexist,core_files]
MOV [fileredact,core_files],[redactor:exifremover:toolpath,core_files]
MOV [fileredact,core_files],[redactor:exifremover:toolpath_desc,core_files]
AMOS END
Where columns were previously of type `TYPE_INTEGER` or `TYPE_FLOAT`
but did not provide numeric data on output, we should change their
type to `TYPE_TEXT` (i.e. the default) to ensure that future work on
numeric aggregation doesn't affect them.
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.
All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing
All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.
Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
Also correctly extract the original file extension.
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
Co-authored-by: Mazitov Artem <maz@2i.tusur.ru>
The parameter $size of the following functions has been deprecated and is not used any more:
- file_extension_icon
- file_file_icon
- file_folder_icon
- file_mimetype_icon
- mimeinfo_from_type
- url_guess_icon
That way, the sized icons (xxxxxxx-yyy.png) can be removed and replaced by SVG, to make it easier
to keep them updated because once they are replaced, there will only be one single file for each
MIME icon.
One of the resource settings, the file type, has been moved to the
activity badge near the activity name.
The rest of the information will be displayed using the afterlink
feature.
However, for now, the activity page still displays all the information
together (that's why resource_get_optional_details() supports now one
new parameter, $showtype, to define whether the file type should be
displayed or not).
The `filename` field was only used by each to determine whether the
file was itself a directory, and it's presence meant that aggregation
of each column wasn't working properly.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
Replace steps that manually add resource instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Because @coversDefaultClass doesn't indicate any coverage (it's
just an alias to avoid having to write the class name in @covers),
this commit fixes all the files that were using that annotation
and missing any @covers.
Basically, replacing one by the other and done.