[ticket/16767] Report missing migration instead of dependency

If a migration has an unfulfillable dependency, the migration causing the
dependency to be unfulfillable is now shown in the error message instead
of just the dependency.

PHPBB3-16767
This commit is contained in:
Patrick Webster 2021-04-25 15:22:42 -05:00
parent a641a992f6
commit 134482f6c2

View file

@ -339,9 +339,10 @@ class migrator
$depend = $this->get_valid_name($depend); $depend = $this->get_valid_name($depend);
// Test all possible namings before throwing exception // Test all possible namings before throwing exception
if ($this->unfulfillable($depend) !== false) $missing = $this->unfulfillable($depend);
if ($missing !== false)
{ {
throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $depend); throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $missing);
} }
if (!isset($this->migration_state[$depend]) || if (!isset($this->migration_state[$depend]) ||