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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ancapaaron created an issue. See original summary.

ancapaaron’s picture

Status: Needs review » Closed (outdated)

It appears that this has been fixed in a newer release so I am closing it.

stmh’s picture

Version: 7.x-5.1 » 7.x-6.5
Status: Closed (outdated) » Active

It 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

stmh’s picture

I 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:

**
 * Implements hook_paragraphs_item_access().
 */
function my_module_paragraphs_item_access($entity, $op, $account) {
  if ($entity->entityType() == 'paragraphs_item') {
    return PARAGRAPHS_ITEM_ACCESS_ALLOW;
  }
}

HTH,

Stephan

rkostov’s picture

This is a patch for 7.x-6.x version for 'Playlist' widget only.

rkostov’s picture

This one solves the issue 'Warning: A non-numeric value encountered in _brightcove_field_playlist_widget_form() (line 140 ...'

nmitev’s picture

Both patches #5 and #6 worked for me. Thanks :)

nmitev’s picture

Status: Active » Fixed
nmitev’s picture

Status: Fixed » Needs work

There 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.

nmitev’s picture

Status: Needs work » Needs review
FileSize
4.23 KB

The 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.