-
Task
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.5
-
None
-
MOODLE_401_STABLE
Context
I am facing a project where I am putting in order a very old plugin, without install.xml nor upgrade.php.
About the warning
The notice that PHP shows is this:
Notice: Undefined variable: suffix in /var/www/html/lib/ddl/database_manager.php on line 273
on Moodle 4.1.5+.
From the source code, I can see that we are assuming that any index or key being managed was previously created with Moodle tools, so assuming there will be always a declarative $suffix set before that line.
When upgrading or dealing with keys and indexes with a different origin rather than Moodle installation or upgrade, this will not be the case. I can imagine easily instances with manually created indexes on the database for whatever reason.
What is expected?
No notice.
I think it would be sufficient by setting before any logic like $suffix = '';. This way, the notice will disappear.