diff --git a/wire/core/Functions.php b/wire/core/Functions.php index 5fce3a61..d48688de 100644 --- a/wire/core/Functions.php +++ b/wire/core/Functions.php @@ -1056,7 +1056,7 @@ function wireClassParents($className, $autoload = true) { if($ns) $className = $ns . $_className; } } - $parents = class_parents(ltrim($className, "\\"), $autoload); + $parents = @class_parents(ltrim($className, "\\"), $autoload); } $a = array(); if(is_array($parents)) foreach($parents as $k => $v) { diff --git a/wire/core/Modules.php b/wire/core/Modules.php index a2d09949..c6a8fa9c 100644 --- a/wire/core/Modules.php +++ b/wire/core/Modules.php @@ -416,6 +416,7 @@ class Modules extends WireArray { if(empty($info['singular'])) continue; $file = $this->paths[1] . "$moduleName/$moduleName.module.php"; if(!file_exists($file) || !$this->includeModuleFile($file, $moduleName)) continue; + if(!isset($info['namespace'])) $info['namespace'] = ''; $className = $info['namespace'] . $moduleName; $module = $this->newModule($className, $moduleName); if($module) parent::set($moduleName, $module); @@ -1486,7 +1487,7 @@ class Modules extends WireArray { } $info = $this->getModuleInfo($module ? $module : $moduleName); - if(empty($info['permission']) && empty($info['permissionMethod'])) return $strict ? false : true; + if(empty($info['permission']) && empty($info['permissionMethod'])) return ($strict ? false : true); if(is_null($user)) $user = $this->wire('user'); if($user && $user->isSuperuser()) return true; @@ -1506,7 +1507,8 @@ class Modules extends WireArray { ); $method = $info['permissionMethod']; $this->includeModule($moduleName); - return $className::$method($data); + if(method_exists($className, $method)) return $className::$method($data); + return false; } return true; diff --git a/wire/core/WireMail.php b/wire/core/WireMail.php index 5c672122..e03efeed 100644 --- a/wire/core/WireMail.php +++ b/wire/core/WireMail.php @@ -3,19 +3,17 @@ /** * ProcessWire WireMail * - * ProcessWire 3.x, Copyright 2019 by Ryan Cramer + * ProcessWire 3.x, Copyright 2021 by Ryan Cramer * https://processwire.com * * #pw-summary A module type that handles sending of email in ProcessWire * #pw-var $m * #pw-body = * - * Below are 3 different ways you can get a new instance of WireMail. - * When possible we recommend using option A or B below. + * Below are 2 different ways you can get a new instance of WireMail. * ~~~~~ - * $m = $mail->new(); // option A - * $m = wireMail(); // option B - * $m = new WireMail(); // option C + * $m = $mail->new(); // option A: use $mail API variable + * $m = wireMail(); // option B: use wireMail() function * ~~~~~ * Once you have an instance of WireMail (`$m`), you can use it to send email like in these examples below. * ~~~~~ @@ -23,7 +21,8 @@ * $m->to('user@domain.com') * ->from('you@company.com') * ->subject('Message Subject') - * ->body('Message Body') + * ->body('Optional message body in plain text') + * ->bodyHTML('
Optional message body in HTML
') * ->send(); * * // separate method call usage @@ -38,10 +37,11 @@ * $m->from('you@company.com', 'Mary Jane'); * * // other methods or properties you might set (or get) - * $m->bodyHTML('