1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-17 12:10:45 +02:00
This commit is contained in:
Ryan Cramer
2023-06-22 10:44:41 -04:00
parent f1c20282f6
commit fc5b67508f

View File

@@ -1264,7 +1264,11 @@ class Modules extends WireArray {
*
*/
public function moduleName($id, $setName = null) {
if(!ctype_digit("$id")) {
if($id instanceof Module) {
$name = $id->className();
if($setName === null) return $name;
$id = $this->getModuleID($name);
} else if(!ctype_digit("$id")) {
if(is_string($id)) return $id;
$id = $this->getModuleID($id);
}