Problem/Motivation

On my site, I install vmh.
On admin/config/varbase/varbase-media-header I select my content types that I have created previously.
I then go to one of my vmh enabled content items and add an external video as the media header.
I get the following error

This entity (media: 434) cannot be referenced.
Notice: Undefined index: #parents in Drupal\Core\Form\FormState->getError() (line 1112 of core/lib/Drupal/Core/Form/FormState.php).
Warning: Invalid argument supplied for foreach() in Drupal\Core\Form\FormState->getError() (line 1112 of core/lib/Drupal/Core/Form/FormState.php).

and it won't save.

Proposed resolution

To fix I need to go to manage fields of the content type and edit the Main Media field (field_media) and add 'Video (external)' to the media types (and any others that I might want to use).

Not sure how this should be fixed within vmh or if it is Drupal media issue, ie the Media browser used by vmh to select media should not be allowing a choice that would cause an error, ie if the content type does not allow external video, then it shouldn't offer it. Of if the error should be picked up to indicate how it can be fixed.
Actually vmh has made it explict:
in varbase_media_header/src/assets/config_templates/node/field.field.node.TOKEN_NODE.field_media.yml
The install has:

  handler_settings:
    target_bundles:
      image: image
      remote_video: remote_video
      video: video

So it should be setting the remote_video to true, but after I have set the video external and export the config it is listed as:
video_embed: video_embed
and the config includes
- media.type.video_embed
So should it be remote_video or video_embed, or both? It's beyond my skill to know. Though I would like to...
The simple solution is for each site owner to just change the field_media settings appropriately. Maybe this needs to be added to the install instructions.

I post here so others can easily find the easy fix, since it took me a little while to work it out.
Please change the status etc of this report to what is appropriate.

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Add a documentation link to have more example of how to use
  • ✅ Change the README.md file to have more info and links
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ✅ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release varbase-9.0.2, varbase_media_header-9.0.1

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Comments

rjzaar created an issue. See original summary.

rjzaar’s picture

Issue summary: View changes
rjzaar’s picture

I've created an improved readme 'patch' with install instructions. I think it would be useful. Cheers.
PS on a clean install of vmh on varbase video external is correctly enabled. It must be my media config...

rajab natshah’s picture

Version: 8.x-7.4 » 9.0.x-dev
rajab natshah’s picture

Component: Code » Documentation
rajab natshah’s picture

Title: vmh on install does not set video (external) on Main Media (field_media) » Have a Doc link for Configuring Varbase Media Header after fixing vmh on install does not set video (external) on Main Media (field_media)

  • RajabNatshah committed fc92528 on 9.0.x authored by rjzaar
    Issue #3106983 by rjzaar: Have a Doc link for Configuring Varbase Media...
rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem
Status: Active » Needs review
Issue tags: +varbase-9.0.2, +varbase_media_header-9.0.1
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Title: Have a Doc link for Configuring Varbase Media Header after fixing vmh on install does not set video (external) on Main Media (field_media) » Add a documentation link for Configuring Varbase Media Header with more examples after fixing vmh on install does not set video (external) on Main Media (field_media)
Issue summary: View changes
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes