mirror of
https://github.com/flarum/core.git
synced 2025-10-14 16:34:26 +02:00
Use extension names instead of IDs when erroring on enable/disable reqs (#2563)
This commit is contained in:
committed by
GitHub
parent
930fcf9250
commit
843daf633d
@@ -114,7 +114,7 @@ class ExtensionManager
|
||||
}
|
||||
|
||||
$this->extensions = $extensions->sortBy(function ($extension, $name) {
|
||||
return $extension->composerJsonAttribute('extra.flarum-extension.title');
|
||||
return $extension->getTitle();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -369,4 +369,17 @@ class ExtensionManager
|
||||
|
||||
return isset($enabled[$extension]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the titles of the extensions passed.
|
||||
*
|
||||
* @param array $exts
|
||||
* @return string[]
|
||||
*/
|
||||
public static function pluckTitles(array $exts)
|
||||
{
|
||||
return array_map(function (Extension $extension) {
|
||||
return $extension->getTitle();
|
||||
}, $exts);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user