Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-15651

Migration 'if' conditions only support booleans

XMLWordPrintable

      The condition of migrations' if statements must be of boolean type. Calling another migration tool is not supported, see: https://github.com/phpbb/phpbb/blob/release-3.2.2/phpBB/phpbb/db/migrator.php#L761-L766

      This does not work as expected:

      ['if', [
          ['module.exists', ['acp', false, 'ACP_FOO']],
          ['module.remove', ['acp', false, 'ACP_FOO']],
      ]],

      The only place in phpBB core where no boolean type is provided is this: https://github.com/phpbb/phpbb/blob/release-3.2.2/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php#L36

      The effect is that module.remove is always called, which is not too serious because module.remove internally checks if the module exists before trying to delete it.

            nicofuma nicofuma [X] (Inactive)
            kasimi kasimi [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: