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 errorThis 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: videoSo 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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3106983-vmh_on_install_does_not_set_video_external_on_Main_Media_field_media.patch | 1.46 KB | rjzaar |
Comments
Comment #2
rjzaar commentedComment #3
rjzaar commentedI'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...
Comment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahThank you, Robert for following up on this issue
#3239800: Switch Varbase Media Header to use Entity Definition Update Manager class from vardot/entity-definition-update-manager class library
That fixes issues with the entity definition and field definition updates.
Varbase documentation
Varbase Media Header Module
Configuring Varbase Media Header
Comment #7
rajab natshahComment #9
rajab natshahComment #10
rajab natshahComment #11
rajab natshahComment #12
rajab natshahComment #13
rajab natshahComment #14
rajab natshahComment #15
rajab natshahComment #17
rajab natshahComment #18
rajab natshahComment #19
rajab natshah