Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote content (YouTube videos) are uneditable and break the CMS when if a video is removed #1344

Closed
NightJar opened this issue Mar 29, 2023 · 1 comment

Comments

@NightJar
Copy link
Contributor

NightJar commented Mar 29, 2023

If one has a page, and that page embeds a YouTube video via the media button in the WYSIWYG, this is good.
Until the video expires for whatever reason.
In this case if one wishes to edit the embed to insert a new valid video link it results in a broken modal that never loads.

public function remoteEditFormSchema(HTTPRequest $request)
{
$schemaID = $request->getURL();
try {
$form = $this->remoteEditForm();
return $this->getSchemaResponse($schemaID, $form);
} catch (NetworkException | RequestException | InvalidRemoteUrlException $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);
}
}

By design the controller action returns HTTP 500, which is not handled by the client (on the front end).
In the least a very confused and frustrated content editor.
In the worst, javascript errors and a non-functioning CMS. (unconfirmed, can't remember)

Test case: https://www.youtube.com/watch?v=IvTJ3cRzVbc

image

PRs

@sabina-talipova
Copy link
Contributor

PR merged. Issue was solved. This will be automatically tagged. Close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants