diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 8de986abfa..b8dbe5834c 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2964,7 +2964,9 @@ class baseRouter if(!empty($this->config->debug) && $this->config->debug > 1) { /* Send non-serious errors to page in zin mode. */ - if((isset($this->config->zin) || isset($_SERVER['HTTP_X_ZIN_OPTIONS'])) && ($level !== E_ERROR && $level !== E_PARSE && $level !== E_CORE_ERROR && $level !== E_COMPILE_ERROR)) + $isZinRequest = isset($this->config->zin) || isset($_SERVER['HTTP_X_ZIN_OPTIONS']); + $isNonSeriousError = $level !== E_ERROR && $level !== E_PARSE && $level !== E_CORE_ERROR && $level !== E_COMPILE_ERROR; + if($isZinRequest && $isNonSeriousError) { $this->zinErrors[] = array('file' => $file, 'line' => $line, 'message' => $message, 'level' => $level); return; diff --git a/lib/zin/core/wg.class.php b/lib/zin/core/wg.class.php index f5fa740ac8..ed65285ad3 100644 --- a/lib/zin/core/wg.class.php +++ b/lib/zin/core/wg.class.php @@ -528,7 +528,10 @@ class wg $definedProps = static::getDefinedProps(); foreach($definedProps as $name => $definition) { - if($this->hasProp($name) || (isset($definition['default']) && $definition['default'] !== null) || (isset($definition['optional']) && $definition['optional'])) continue; + if($this->hasProp($name)) continue; + if(isset($definition['default']) && $definition['default'] !== null) continue; + if(isset($definition['optional']) && $definition['optional']) continue; + trigger_error("[ZIN] The property \"$name: {$definition['type']}\" of widget \"{$this->type()}#$this->gid\" is required.", E_USER_ERROR); } }