code/Extensions/RemoteFileModalExtension.php
public function remoteEditFormSchema(HTTPRequest $request)
    {
        $schemaID = $request->getURL();
        try {
            $form = $this->remoteEditForm();
            return $this->getSchemaResponse($schemaID, $form);
        } catch (InvalidUrlException $exception) {
            $errors = ValidationResult::create()
                ->addError($exception->getMessage());
            // @todo - Don't create dummy form (pass $form = null)
            $form = Form::create(null, 'Form', FieldList::create(), FieldList::create());
            $code = $exception->getCode();

            if ($code < 300) {
                $code = 500;
            }

            return $this
                ->getSchemaResponse($schemaID, $form, $errors)
                ->setStatusCode($code);
        }
    }
public function remoteEditFormSchema(HTTPRequest $request)
    {
        $schemaID = $request->getURL();
        try {
            $form = $this->remoteEditForm();
            return $this->getSchemaResponse($schemaID, $form);
        } catch (InvalidUrlException $exception) {
            $errors = ValidationResult::create()
                ->addError($exception->getMessage());
            // @todo - Don't create dummy form (pass $form = null)
            $form = Form::create(null, 'Form', FieldList::create(), FieldList::create());
            $code = $exception->getCode();

            if ($code < 300) {
                $code = 500;
            }

            return $this
                ->getSchemaResponse($schemaID, $form, $errors)
                ->setStatusCode($code);
        }
    }
public function remoteEditFormSchema ( HTTPRequest $ request ) { $ schemaID = $ request -> getURL ( ) ; try { $ form = $ this -> remoteEditForm ( ) ; return $ this -> getSchemaResponse ( $ schemaID , $ form ) ; } catch ( InvalidUrlException $ exception ) { $ errors = ValidationResult :: create ( ) -> addError ( $ exception -> getMessage ( ) ) ; // @todo - Don't create dummy form (pass $form = null) $ form = Form :: create ( null , 'Form' , FieldList :: create ( ) , FieldList :: create ( ) ) ; $ code = $ exception -> getCode ( ) ; if ( $ code < 300 ) { $ code = 500 ; } return $ this -> getSchemaResponse ( $ schemaID , $ form , $ errors ) -> setStatusCode ( $ code ) ; } }
Capture the schema handling process, as there is validation done to the URL provided before form is generated

@param HTTPRequest $request
@return HTTPResponse
Capture the schema handling process as there is validation done to the URL provided before form is generated