diff --git a/wire/core/Debug.php b/wire/core/Debug.php index 7e122958..898de341 100644 --- a/wire/core/Debug.php +++ b/wire/core/Debug.php @@ -376,7 +376,7 @@ class Debug { $obj = null; $class = ''; $type = ''; - $args = $trace['args']; + $args = isset($trace['args']) ? $trace['args'] : array(); $argStr = ''; $file = $trace['file']; $basename = basename($file); diff --git a/wire/core/PagesRaw.php b/wire/core/PagesRaw.php index b8030dfb..99b08041 100644 --- a/wire/core/PagesRaw.php +++ b/wire/core/PagesRaw.php @@ -837,7 +837,7 @@ class PagesRawFinder extends Wire { if(!isset($templatesById[$templateId])) $templatesById[$templateId] = $templates->get($templateId); $template = $templatesById[$templateId]; /** @var Template $template */ $slash = $template->slashUrls ? '/' : ''; - $path = strlen($value) && $value !== '/' ? "$value$slash" : ''; + $path = strlen("$value") && $value !== '/' ? "$value$slash" : ''; if(isset($this->runtimeFields['url'])) { $this->values[$id]['url'] = $rootUrl . $path; } diff --git a/wire/modules/Fieldtype/FieldtypeFloat.module b/wire/modules/Fieldtype/FieldtypeFloat.module index 60bdd01b..8f1bf6b8 100644 --- a/wire/modules/Fieldtype/FieldtypeFloat.module +++ b/wire/modules/Fieldtype/FieldtypeFloat.module @@ -8,7 +8,7 @@ * For documentation about the fields used in this class, please see: * /wire/core/Fieldtype.php * - * ProcessWire 3.x, Copyright 2022 by Ryan Cramer + * ProcessWire 3.x, Copyright 2024 by Ryan Cramer * https://processwire.com * */ @@ -115,17 +115,18 @@ class FieldtypeFloat extends Fieldtype { * * @param Page $page * @param Field $field - * @param string|float|int + * @param string|float|int|null $value * @return string * */ public function ___sleepValue(Page $page, Field $field, $value) { + if($value === null) return ''; // blank value $precision = $field->get('precision'); if(is_null($precision) || $precision === '' || $precision < 0) { $precision = self::getPrecision($value); } if(!is_string($value)) { - $value = number_format($value, $precision, '.', ''); + $value = number_format((float) $value, $precision, '.', ''); } return $value; } @@ -238,4 +239,3 @@ class FieldtypeFloat extends Fieldtype { } - diff --git a/wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeText.php b/wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeText.php index cfdde05a..7876a7c5 100644 --- a/wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeText.php +++ b/wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeText.php @@ -47,7 +47,7 @@ class InputfieldDatetimeText extends InputfieldDatetimeType { 'showAnim' => 'fade', 'changeMonth' => true, 'changeYear' => true, - 'showButtonPane' => false, + 'showButtonPanel' => false, 'numberOfMonths' => 1, 'showMonthAfterYear' => false, 'showOtherMonths' => false, @@ -483,7 +483,7 @@ class InputfieldDatetimeText extends InputfieldDatetimeType { $f = $inputfields->InputfieldToggle; $f->attr('name', 'showButtonPanel'); $f->label = $this->_('Display “Today” and “Done” buttons under calendar?'); - $f->val($module->get('showButtonPane')); + $f->val($module->get('showButtonPanel')); $f->columnWidth = 50; $fieldset->add($f); diff --git a/wire/modules/Inputfield/InputfieldMarkup.module b/wire/modules/Inputfield/InputfieldMarkup.module index eb9f3085..6305a2bd 100644 --- a/wire/modules/Inputfield/InputfieldMarkup.module +++ b/wire/modules/Inputfield/InputfieldMarkup.module @@ -85,7 +85,7 @@ class InputfieldMarkup extends InputfieldWrapper { $markupFunction = $this->getSetting('markupFunction'); $markupText = $this->getSetting('markupText'); $textformatters = $this->getSetting('textformatters'); - $description = $this->getSetting('description'); + $description = (string) $this->getSetting('description'); if($markupFunction !== null & is_callable($markupFunction)) { $out .= "\n" . call_user_func($markupFunction, $this); @@ -181,4 +181,3 @@ class InputfieldMarkup extends InputfieldWrapper { } } - diff --git a/wire/modules/Inputfield/InputfieldText/InputfieldText.module b/wire/modules/Inputfield/InputfieldText/InputfieldText.module index f91cbb03..a4372f1f 100644 --- a/wire/modules/Inputfield/InputfieldText/InputfieldText.module +++ b/wire/modules/Inputfield/InputfieldText/InputfieldText.module @@ -166,7 +166,7 @@ class InputfieldText extends Inputfield { if(!empty($attrs['placeholder']) && $this->wire()->languages) { $language = $this->wire()->user->language; if($language && $language->id && !$language->isDefault()) { - $placeholder = parent::get("placeholder$language->id"); + $placeholder = (string) parent::get("placeholder$language->id"); if(strlen($placeholder)) $attrs['placeholder'] = $placeholder; } } @@ -229,6 +229,7 @@ class InputfieldText extends Inputfield { * */ protected function getValueLength($value, $countWords = false) { + $value = (string) $value; if($countWords) { return str_word_count($value); } else { diff --git a/wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module b/wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module index 5e58a7c4..b97b79d3 100644 --- a/wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module +++ b/wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module @@ -547,7 +547,7 @@ class MarkupPagerNav extends Wire implements Module { } } else { - $queryString .= "$key=" . urlencode($value) . "&"; + $queryString .= "$key=" . urlencode("$value") . "&"; } } $this->queryString = htmlspecialchars(rtrim($queryString, "?&")); diff --git a/wire/modules/Process/ProcessLogger/ProcessLogger.module b/wire/modules/Process/ProcessLogger/ProcessLogger.module index b1ba1561..be362f96 100644 --- a/wire/modules/Process/ProcessLogger/ProcessLogger.module +++ b/wire/modules/Process/ProcessLogger/ProcessLogger.module @@ -375,6 +375,8 @@ class ProcessLogger extends Process { 'text' => $this->_x('Text', 'th'), ); + if(!is_array($templateItem)) $templateItem = $headers; + if(empty($templateItem['user']) && empty($templateItem['url'])) { unset($templateItem['user'], $templateItem['url']); $table->headerRow(array( diff --git a/wire/modules/Process/ProcessPageClone.module b/wire/modules/Process/ProcessPageClone.module index 80f9aaa0..e0b87b7d 100644 --- a/wire/modules/Process/ProcessPageClone.module +++ b/wire/modules/Process/ProcessPageClone.module @@ -258,7 +258,7 @@ class ProcessPageClone extends Process implements ConfigurableModule { $titleField->set("value$language->id", $value); } if($nameUseLanguages) { - $value = $page->get("name$language->id"); + $value = (string) $page->get("name$language->id"); if(strlen($value)) { if(!empty($suggested["name$language"])) { $nameLang = $suggested["name$language"];