Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79622

database_manager warns about undefined suffix variable

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.5
    • Database SQL/XMLDB
    • 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.

            Unassigned Unassigned
            jpahullo Jordi Pujol-Ahulló
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.