Skip to content

Commit

Permalink
API Rename FormField Value to getFormattedValue
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 21, 2025
1 parent 7a7755c commit 7ef8cbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/Forms/SiteTreeURLSegmentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SiteTreeURLSegmentField extends TextField
'suggest'
];

public function Value()
public function getFormattedValue(): string
{
return rawurldecode($this->value ?? '');
}
Expand Down Expand Up @@ -96,8 +96,8 @@ public function suggest($request)
public function getPage()
{
$idField = $this->getForm()->Fields()->dataFieldByName('ID');
return ($idField && $idField->Value())
? SiteTree::get()->byID($idField->Value())
return ($idField && $idField->getValue())
? SiteTree::get()->byID($idField->getValue())
: SiteTree::singleton();
}

Expand Down Expand Up @@ -171,7 +171,7 @@ public function Type()

public function getURL()
{
return Controller::join_links($this->getURLPrefix(), $this->Value(), $this->getURLSuffix());
return Controller::join_links($this->getURLPrefix(), $this->getValue(), $this->getURLSuffix());
}

public function performReadonlyTransformation()
Expand Down

0 comments on commit 7ef8cbd

Please sign in to comment.