Skip to content

Commit

Permalink
Merge branch '2' into 3
Browse files Browse the repository at this point in the history
# Conflicts:
#	code/Extensions/RemoteFileModalExtension.php
  • Loading branch information
GuySartorelli committed Nov 27, 2024
2 parents f27967f + e8bd854 commit 1be8a05
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/Extensions/RemoteFileModalExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SilverStripe\Core\Convert;
use SilverStripe\Core\Extension;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\Schema\FormSchema;
Expand All @@ -34,17 +35,21 @@ class RemoteFileModalExtension extends Extension

/**
* @return HTTPRequest
* @deprecated 2.4.0 Use $this->getOwner()->getRequest() instead.
*/
protected function getRequest()
{
Deprecation::notice('2.4.0', 'Use $this->getOwner()->getRequest() instead.');
return $this->getOwner()->getRequest();
}

/**
* @return FormSchema
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it.
*/
protected function getFormSchema()
{
Deprecation::noticeWithNoReplacment('2.4.0');
return FormSchema::singleton();
}

Expand All @@ -70,7 +75,7 @@ public function remoteCreateForm()
*/
public function remoteEditForm()
{
$url = $this->getRequest()->requestVar('embedurl');
$url = $this->getOwner()->getRequest()->requestVar('embedurl');
$form = null;
$form = Injector::inst()->get(RemoteFileFormFactory::class)
->getForm(
Expand Down Expand Up @@ -117,10 +122,12 @@ public function remoteEditFormSchema(HTTPRequest $request)
* @param ValidationResult $errors Required for 'error' response
* @param array $extraData Any extra data to be merged with the schema response
* @return HTTPResponse
* @deprecated 2.4.0 Will be replaced with $this->getOwner()->getSchemaResponse() instead.
*/
protected function getSchemaResponse($schemaID, $form = null, ValidationResult $errors = null, $extraData = [])
{
$parts = $this->getRequest()->getHeader(FormSchemaController::SCHEMA_HEADER);
Deprecation::noticeWithNoReplacment('2.4.0', 'Will be replaced with $this->getOwner()->getSchemaResponse() instead.');
$parts = $this->getOwner()->getRequest()->getHeader(FormSchemaController::SCHEMA_HEADER);
$data = $this
->getFormSchema()
->getMultipartSchema($parts, $schemaID, $form, $errors);
Expand Down

0 comments on commit 1be8a05

Please sign in to comment.