Skip to content

Require a video Id #12

@JamesDPC

Description

@JamesDPC

If I save an e.g. ElementFeaturedVideo without a video id value (the Video property), the call to e.g. getEmbedUrl fails as it expects a string videoId rather than a null. It should be made a required field.

Acceptance Criteria

  • There is a validateVideoCode method in the VideoFromProvider trait. The video Id (video code) is passed to this. Check if the video id passed is an empty string
  • If it is an empty string, throw a ValidationException with translateable instructions for the user, using the current URL check as a guide.
  • The getVideoid() method in the VideoFromProvider trait should return a string, add this as a return type. The default if the Video property is not set is a null, so this will need to be handled.
  • write a test that tries to save and ElementFeaturedVideo or GalleryVideo without a Video property value. It should throw a ValidationException that can be checked in the unit test as an assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions