diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php index 1112bafb203..c3d2ace4921 100644 --- a/lib/ddl/database_manager.php +++ b/lib/ddl/database_manager.php @@ -502,7 +502,7 @@ class database_manager { // Check new table doesn't exist if ($this->table_exists($check)) { - throw new ddl_exception('ddltablealreadyexists', $xmldb_table->getName(), 'can not rename table'); + throw new ddl_exception('ddltablealreadyexists', $check->getName(), 'can not rename table'); } if (!$sqlarr = $this->generator->getRenameTableSQL($xmldb_table, $newname)) {