From 554552d2efe60230006423d7348e731ce4cb040f Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 14 Jan 2025 16:16:35 +1300 Subject: [PATCH] API Rename FormField Value to getFormattedValue --- src/Forms/TextCheckboxGroupField.php | 4 ++-- src/Models/BaseElement.php | 2 +- tests/Behat/Context/FeatureContext.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Forms/TextCheckboxGroupField.php b/src/Forms/TextCheckboxGroupField.php index 53133d14..f47dd736 100644 --- a/src/Forms/TextCheckboxGroupField.php +++ b/src/Forms/TextCheckboxGroupField.php @@ -94,7 +94,7 @@ public function performReadonlyTransformation() if ($titleField) { $field->replaceField('Title', LiteralField::create( 'Title', - $titleField->Value() + $titleField->getFormattedValue() )); } @@ -104,7 +104,7 @@ public function performReadonlyTransformation() if ($showTitle) { $field->replaceField('ShowTitle', LiteralField::create( 'ShowTitle', - $showTitle->Value() === 'Yes' ? $displayedText : $notDisplayedText + $showTitle->getValue() === 'Yes' ? $displayedText : $notDisplayedText )->addExtraClass('show-title')); } } diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php index 54f9dc5c..d99a97e5 100644 --- a/src/Models/BaseElement.php +++ b/src/Models/BaseElement.php @@ -750,7 +750,7 @@ public function getAnchorsInContent(): array foreach ($allFields as $field => $fieldSpec) { $fieldObj = $this->owner->dbObject($field); if ($fieldObj instanceof DBHTMLText) { - $parseSuccess = preg_match_all($anchorRegex, $fieldObj->getValue() ?? '', $matches); + $parseSuccess = preg_match_all($anchorRegex, $fieldObj->getFormattedValue() ?? '', $matches); if ($parseSuccess >= 1) { $fieldAnchors = array_values(array_filter( array_merge($matches[3], $matches[5]) diff --git a/tests/Behat/Context/FeatureContext.php b/tests/Behat/Context/FeatureContext.php index 8bed304a..dacb2c43 100644 --- a/tests/Behat/Context/FeatureContext.php +++ b/tests/Behat/Context/FeatureContext.php @@ -255,7 +255,7 @@ public function theFieldForBlockShouldContain($field, $blockNumber, $negate, $co return; } - $actual = (string) $fieldElem->getValue(); + $actual = (string) $fieldElem->getFormattedValue(); $regex = '/^' . preg_quote($content, '/') . '$/ui'; if ($negate) {