-
Improvement
-
Resolution: Fixed
-
Minor
-
4.4
-
MOODLE_404_STABLE
-
MOODLE_404_STABLE
-
MDL-80005-main-squashed -
At the moment we have a load of PARAM_ definitions and they are all validated in the clean_param() method, which is called by other methods.
Unfortunately that's the limit of it, and there is no easy way to check that a parameter type is, itself, valid. The first you can find out that it doesn't exist is when you call clean_param() and get an exception.
There is also no way to find out which PARAM definitions are themselves deprecated. IN fact, we have hundreds of uses of supposedly deprecated param types.
I propose that we:
- add a get_param_types() with an authoritative list of definitions
- add a get_deprecated_param_types() with an authoritative list of deprecated definitions
- add helpers for is_valid_param_type(): bool and is_deprecated_param_type(): bool
From there we can update the clean_param() to make use of the new methods and then we can start to emit deprecation notices for deprecated params. We can also consume these in the code sniffer.
I would propose adding these to a new core\param class and start to consider migrating those existing methods to that class (without deprecation). This is more just to bring everything together into a single place and make things easier to maintain. We may (in the very distant future) update all uses of those methods to use the new methods, but that would likely be a part of other work we have going on with web services, and frontend changes.
- blocks
-
MDL-80042 Emit deprecation notices for deprecated PARAM_ types
-
- Open
-
-
MDL-80677 Improve \core\deprecated usage
-
- Closed
-
- has to be done before
-
MDL-81134 Remove upgrade critical requires
-
- Open
-
- is blocked by
-
MDL-78496 Decide Moodle 4.4 requirements and push them to environment.xml (due date for voting: 2023-11-13)
-
- Closed
-
- links to