Hi All,
When using the brightcove module in conjunction with paragraphs the autocomplete and browse functionality don't show up. What happens is that the $entity_type variable gets set as "paragraphs_item" when the widget HOOK gets fired and the brightcove widget is nested in a paragraph. Normally the brightcove field widget is expected to be embedded on a node, so that variable ends up being "node" instead.
That variable is then used to construct an autocomplete path URL, and in typical drupal fashion that URL is broken down as page_access arguments in HOOK_menu. Since 'paragraphs_item' is an invalid argument the constructed url for autocomplete and browse fail to work.
What I have done is made the brightcove module aware of the 'paragraphs_item' entity type, and I have it translated to the 'node' entity type which corrects the problem. Although I am not 100% certain this is the best way to correct this issue.
Attached is the patch that I worked on to fix the problem.
Comments
Comment #2
ancapaaron CreditAttribution: ancapaaron as a volunteer and commentedIt appears that this has been fixed in a newer release so I am closing it.
Comment #3
stmh CreditAttribution: stmh at Factorial GmbH commentedIt seems that this is still an issue, I can reproduce the bug on my end with 7.x-6.5. Will try to provide a patch
Comment #4
stmh CreditAttribution: stmh at Factorial GmbH commentedI debugged the issue a little bit and it's not technically a bug, there's no module who implements the entity_access for paragraphs_items.
To fix this add this to custom module:
HTH,
Stephan
Comment #5
rkostov CreditAttribution: rkostov at FFW commentedThis is a patch for 7.x-6.x version for 'Playlist' widget only.
Comment #6
rkostov CreditAttribution: rkostov at FFW commentedThis one solves the issue 'Warning: A non-numeric value encountered in _brightcove_field_playlist_widget_form() (line 140 ...'
Comment #7
nmitev CreditAttribution: nmitev commentedBoth patches #5 and #6 worked for me. Thanks :)
Comment #8
nmitev CreditAttribution: nmitev commentedComment #9
nmitev CreditAttribution: nmitev commentedThere is some additional problem. Both patches fix the problem but just for the first paragraph item. If additional paragraphs are added the playlist is still broken.
Comment #10
nmitev CreditAttribution: nmitev at FFW commentedThe problems with Playlist not behaving as expected when used in multiple paragraphs on one node comes from the AJAX IDs which are the same for all field instances. Therefor then user clicks on one of the buttons - Previous or Next, the functionality works just for one paragraph instance and if multiple paragraphs are in place nothing happens. There I propose change to the AJAX IDs to be different for each paragraph instance and to be based on the element parents array as it has been used before.
For the cases when no paragraphs are used the functionality has been preserved.