Exception raised when i use Migrations->markMigrated(xxx)


#1

Hi everybody,
i have an exception raised when i try to mark migrated a migration, this is the full exception error :
You need to pass a ConfigInterface object for your first getManager() call

This is my code :
> $migrations = new Migrations();
> if ($migrations->markMigrated($migration_ref)) {
> $this->Flash->success(__(‘Migration marquée comme migrée’));
> }

I use the latest version of CakePHP v3.3.13 and phinx v0.6.5

Somebody can help me please ?
Many thanks.
Regards
Cyb


#2

Sorry to bump but someone have an idea ?


#3

Hey,

I know this thread is quite old now but I am facing the same issue.

I have fixed it by editing vendor/cakephp/migrations/src/Migrations.php
replacing line 222 $this->getManager()->getVersionsToMark($input), by
$this->getManager($this->getConfig())->getVersionsToMark($input),

I think we should open an issue on https://github.com/cakephp/migrations/issues and/or submit a PR :wink:


#4

Thanks for your answer, i’ll do a PR