Problem/Motivation

Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 9.

To read more about this effort by the Drupal Association, please read: Accelerating Drupal 9 module and theme readiness with automated patches

Periodically patches will be added to this issue that remove Drupal 9 deprecations. To stop further patches from being posted simply close this issue(any status besides Active, Needs Review or Needs work) or remove the "ProjectUpdateBotD9" tag from the issue.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open(status of Active, Needs Review or Needs work) and the "ProjectUpdateBotD9" tag is left on this issue, new patches will be posted periodically if new deprecations are needed.

    As the Drupal Rector project improves and is able to fix more deprecations the patches posted here will cover more of the deprecations in the module.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecations but don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD9" from the issue.

    You can use Drupal Rector yourself to make these patches.

    If you want to receive automated patches again simply add back the "ProjectUpdateBotD9" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful they can simply close this issue(any status besides Active, Needs Review or Needs work) and no more automated patches will be posted here.

    If the issue is reopened then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 9 compatibility it may be useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the patch in the comment by Project Update Bot
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear,  use the Infrastructure project issue queue using the component “Bot: Drupal Rector”.

Issue fork brightcove-3146320

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new19.99 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 9 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 9.

Currently Drupal-Rector, version 0.5.5, cannot fix all Drupal 9 compatibility problems.

This patch does not update the info.yml file for Drupal 9 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 9 compatibility fixes as they become available in Drupal-Rector.

Debug info

Bot run #1477

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 0.12.3
  2. palantirnet/drupal-rector: 0.5.5
  3. rector/rector-prefixed: dev-master
gobinathm’s picture

There are other issue on this module apart from the once autofixed by Rector

------ -----------------------------------------------------------------------
  Line   brightcove.install
 ------ -----------------------------------------------------------------------
  227    Call to deprecated method applyUpdates() of class
         Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface:
         in drupal:8.7.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::getChange
         List()
         and execute each entity type and field storage update manually
         instead.
 ------ -----------------------------------------------------------------------

 ------ -----------------------------------------------------------------
  Line   brightcove.module
 ------ -----------------------------------------------------------------
  261    Call to deprecated function system_get_info():
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use
         \Drupal::service('extension.list.$type')->getExtensionInfo() or
         \Drupal::service('extension.list.$type')->getAllInstalledInfo()
         instead.
  357    Call to deprecated method getVocabularyId() of class
         Drupal\taxonomy\TermInterface:
         in drupal:8.?.? and is removed from drupal:9.0.0. Use
         TermInterface::bundle() instead.
 ------ -----------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------
  Line   modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php
 ------ ---------------------------------------------------------------------------------
         Class Drupal\media_entity\MediaTypeBase not found.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
  19     Class Drupal\media_entity\MediaTypeBase not found.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ---------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------
  Line   src/BrightcovePlaylistListBuilder.php
 ------ ---------------------------------------------------------------------
  21     Usage of deprecated trait Drupal\Core\Routing\LinkGeneratorTrait in
         class Drupal\brightcove\BrightcovePlaylistListBuilder:
         in drupal:8.0.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Link instead.
  106    Call to deprecated method l() of class
         Drupal\brightcove\BrightcovePlaylistListBuilder:
         in drupal:8.0.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\Link::fromTextAndUrl() instead.
 ------ ---------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/BrightcoveUtil.php
 ------ ----------------------------------------------------------------------
  199    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  209    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  215    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  220    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ---------------------------------------------------------------------
  Line   src/BrightcoveVideoListBuilder.php
 ------ ---------------------------------------------------------------------
  23     Usage of deprecated trait Drupal\Core\Routing\LinkGeneratorTrait in
         class Drupal\brightcove\BrightcoveVideoListBuilder:
         in drupal:8.0.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Link instead.
  111    Call to deprecated method l() of class
         Drupal\brightcove\BrightcoveVideoListBuilder:
         in drupal:8.0.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\Link::fromTextAndUrl() instead.
 ------ ---------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Controller/BrightcoveSubscriptionController.php
 ------ ----------------------------------------------------------------------
  208    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  251    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  283    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  303    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  306    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  325    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  328    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  395    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  398    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ---------------------------------------------------------------
  Line   src/Entity/BrightcoveTextTrack.php
 ------ ---------------------------------------------------------------
  271    Call to deprecated constant NODE_NOT_PUBLISHED: Deprecated in
         drupal:8.?.? and is removed from drupal:9.0.0. Use
         \Drupal\node\NodeInterface::NOT_PUBLISHED instead.
  271    Call to deprecated constant NODE_PUBLISHED: Deprecated in
         drupal:8.?.? and is removed from drupal:9.0.0. Use
         \Drupal\node\NodeInterface::PUBLISHED instead.
 ------ ---------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Entity/BrightcoveVideo.php
 ------ ----------------------------------------------------------------------
  172    Call to deprecated constant FILE_CREATE_DIRECTORY: Deprecated in
         drupal:8.7.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY.
  172    Call to deprecated constant FILE_MODIFY_PERMISSIONS: Deprecated in
         drupal:8.7.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\File\FileSystemInterface::MODIFY_PERMISSIONS.
  172    Call to deprecated function file_prepare_directory():
         in drupal:8.7.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().
  924    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  928    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ---------------------------------------------------------------
  Line   src/Entity/BrightcoveVideoPlaylistCmsEntity.php
 ------ ---------------------------------------------------------------
  80     Call to deprecated constant NODE_NOT_PUBLISHED: Deprecated in
         drupal:8.?.? and is removed from drupal:9.0.0. Use
         \Drupal\node\NodeInterface::NOT_PUBLISHED instead.
  80     Call to deprecated constant NODE_PUBLISHED: Deprecated in
         drupal:8.?.? and is removed from drupal:9.0.0. Use
         \Drupal\node\NodeInterface::PUBLISHED instead.
 ------ ---------------------------------------------------------------

 ------ -----------------------------------------------------------------
  Line   src/EventSubscriber/BrightcoveInitSubscriber.php
 ------ -----------------------------------------------------------------
  22     Call to deprecated function system_get_info():
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use
         \Drupal::service('extension.list.$type')->getExtensionInfo() or
         \Drupal::service('extension.list.$type')->getAllInstalledInfo()
         instead.
 ------ -----------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcoveAPIClientDeleteForm.php
 ------ ----------------------------------------------------------------------
  96     Parameter $query_factory of method
         Drupal\brightcove\Form\BrightcoveAPIClientDeleteForm::__construct()
         has typehint with deprecated class
         Drupal\Core\Entity\Query\QueryFactory:
         in drupal:8.3.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\Entity\EntityStorageInterface::getQuery() or
         \Drupal\Core\Entity\EntityStorageInterface::getAggregateQuery()
         instead.
  253    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ -----------------------------------------------------------------------
  Line   src/Form/BrightcoveAPIClientForm.php
 ------ -----------------------------------------------------------------------
  96     Parameter $query_factory of method
         Drupal\brightcove\Form\BrightcoveAPIClientForm::__construct() has
         typehint with deprecated class Drupal\Core\Entity\Query\QueryFactory:
         in drupal:8.3.0 and is removed from drupal:9.0.0. Use
         \Drupal\Core\Entity\EntityStorageInterface::getQuery() or
         \Drupal\Core\Entity\EntityStorageInterface::getAggregateQuery()
         instead.
  320    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  344    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  353    Call to deprecated method urlInfo() of class
         Drupal\Core\Entity\EntityInterface:
         in drupal:8.0.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Entity\EntityInterface::toUrl() instead.
 ------ -----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcovePlaylistForm.php
 ------ ----------------------------------------------------------------------
  108    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  114    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  121    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcoveSubscriptionDeleteForm.php
 ------ ----------------------------------------------------------------------
  64     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  79     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  82     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcoveSubscriptionForm.php
 ------ ----------------------------------------------------------------------
  98     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  105    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  108    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcoveTextTrackForm.php
 ------ ----------------------------------------------------------------------
  33     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  39     Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/BrightcoveVideoForm.php
 ------ ----------------------------------------------------------------------
  265    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  271    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  278    Call to deprecated function drupal_set_message():
         in drupal:8.5.0 and is removed from drupal:9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------

 ------ -----------------------------------------------------------------------
  Line   src/Form/BrightcoveVideoPlaylistForm.php
 ------ -----------------------------------------------------------------------
  34     Parameter $entity_manager of method
         Drupal\brightcove\Form\BrightcoveVideoPlaylistForm::__construct() has
         typehint with deprecated interface
         Drupal\Core\Entity\EntityManagerInterface:
         in drupal:8.0.0 and is removed from drupal:9.0.0.
 ------ -----------------------------------------------------------------------
byrond’s picture

This patch adds a couple more compatibility fixes for D9. The only items remaining are:

In brightcove.install:122
Call to deprecated method applyUpdates() of class Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface. Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::getChangeList() and execute each entity type and field storage update manually instead.

This install hook would not work as of Drupal 8.7 anyway.

In modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php
Class Drupal\media_entity\MediaTypeBase not found.

This module is deprecated and slated to be removed. It only works with Media Entity which likely won't have a Drupal 9 release: #3137216: Drupal 9 Compatibility

The new patch contains fixes for the calls to drush_print() and adds a core version requirement to the Media Brightcove module.

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'upgrade_status_ascii_export' -->
<!-- BEGIN OUTPUT from 'modules/contrib/upgrade_status/templates/upgrade-status-ascii-export.html.twig' -->
CUSTOM PROJECTS
--------------------------------------------------------------------------------
Brightcove
Scanned on Thu, 10/22/2020 - 16:41.

1 error found. 5 warnings found.

web/modules/contrib/brightcove/brightcove.drush.inc:
┌──────────┬──────┬────────────────────────────────────────────┐
│  STATUS  │ LINE │                  MESSAGE                   │
├──────────┼──────┼────────────────────────────────────────────┤
│ Check    │ 33   │ Call to deprecated function drush_print(). │
│ manually │      │                                            │
│ Check    │ 36   │ Call to deprecated function drush_print(). │
│ manually │      │                                            │
└──────────┴──────┴────────────────────────────────────────────┘

web/modules/contrib/brightcove/brightcove.install:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS  │ LINE │                           MESSAGE                            │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 227  │ Call to deprecated method applyUpdates() of class            │
│         │      │ Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface.   │
│         │      │ Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. │
│         │      │ Use                                                          │
│         │      │ \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface:: │
│         │      │ getChangeList() and execute each entity type and field       │
│         │      │ storage update manually instead.                             │
│         │      │                                                              │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘

web/modules/contrib/brightcove/modules/media_entity_brightcove/src/Plugin/MediaE
ntity/Type/BrightcoveVideo.php:
┌──────────┬──────┬────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                      MESSAGE                       │
├──────────┼──────┼────────────────────────────────────────────────────┤
│ Check    │      │ Class Drupal\media_entity\MediaTypeBase not found. │
│ manually │      │                                                    │
│ Check    │ 19   │ Class Drupal\media_entity\MediaTypeBase not found. │
│ manually │      │                                                    │
└──────────┴──────┴────────────────────────────────────────────────────┘

web/modules/contrib/brightcove/modules/media_brightcove/media_brightcove.info.ym
l:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                           MESSAGE                            │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check    │ 0    │ Add core_version_requirement: ^8 || ^9 to designate that the │
│ manually │      │ module is compatible with Drupal 9. See                      │
│          │      │ https://drupal.org/node/3070687.                             │
│          │      │                                                              │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘

<!-- END OUTPUT from 'modules/contrib/upgrade_status/templates/upgrade-status-ascii-export.html.twig' -->
byrond’s picture

Issue tags: -ProjectUpdateBotD9

Removing the bot tag, since we're doing this manually. Feel free to add it back if needed.

gobinathm’s picture

Only Open issue after the Merge Request

 ------ ---------------------------------------------------------------------------------
  Line   modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php
 ------ ---------------------------------------------------------------------------------
         Class Drupal\media_entity\MediaTypeBase not found.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
  19     Class Drupal\media_entity\MediaTypeBase not found.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ---------------------------------------------------------------------------------

 [ERROR] Found 2 errors
kerasai’s picture

Hi there!

I've performed a 8.9 to 9.1 upgrade using the branch from the PR, and the functionality seems to work. Note, my primary use case is syndicating Brightcove Videos within the Drupal site, nothing too fancy.

The Composer management didn't work 100% as expected, as I had to explicitly require drupal/time_formatter. I expect I'd need to require drupal/inline_entity_form as well, but I already had it. These two dependencies should be declared in the main composer.json for this project. I didn't notice any other non-core dependencies.

Speaking of the Time Formatter, it'd be grand to roll a 2.x.x release (alpha?) so there's something specific to pull in, as opposed to a potentially-constantly changing dev.

As for the remaining issues in the upgrade status report, those pertain to the contrib media_entity which has been deprecated for quite some time. We should either (1) leave this as-is, or (2) remove this submodule and roll a new 3.x.x branch where D9 compatibility is introduced.

Let me know if there's anything further I can do to push this ahead. Thanks!

kerasai’s picture

Hi there, just checking back in to see if anyone had any thoughts/feedback/etc on pushing this forward. This is the last of the dependencies holding up one of my projects from upgrading to D9. This is a doozey of a module, I get it, but let me know if there's anything I can do to assist.

Thanks!

hidabe’s picture

Same problem here with drupal/time_formatter, @kerasai, too, when i require it from my main composer.json (in my project), no is working with brightcove library :(

bhanu951’s picture

For anyone who are trying to install brightcove on D9 here is the guide :
1. First install the latest dev version of time_formatter module using composer require 'drupal/time_formatter:2.0.x-dev@dev'
2. Follow this guide to install latest dev version of Brighcove module on Drupal 9 site https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-...
3.Apply the attached patch.
4.Execute composer update drupal/brightcove

tushar1’s picture

Updated patch #11 with removing Core:8.x from info.yml files

drewble’s picture

Patch #12 applied successfully, but was completely broken as far as API Client config load, save, and delete were concerned. These issues were not new to #12. I've fixed the issues I found in the existing patch code and added the config_export declaration in Entity/BrightcoveApiClient. This resolved the issues for me.

Ravi_3596’s picture

Status: Needs review » Reviewed & tested by the community

Patch #13 applied successfully.

Aliaksandr Muraveiko’s picture

Hi all,
I have applied the #13 patch and getting the error:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "entity.manager". in Drupal\Component\DependencyInjection\Container->get() (line 151 of core/lib/Drupal/Component/DependencyInjection/Container.php).
when try to add Brightcove video.
I see in the BrightcoveVideoPlaylistForm.php file is still used the service "entity.manager" although it was removed in 9 version.

Aliaksandr Muraveiko’s picture

Status: Reviewed & tested by the community » Needs work
Aliaksandr Muraveiko’s picture

Aliaksandr Muraveiko’s picture

Status: Needs work » Needs review
gobinathm’s picture

StatusFileSize
new73.96 KB

This PR now covers all the fixes from Previous PR + Patch files shared in this thread

https://git.drupalcode.org/project/brightcove/-/merge_requests/2#note_23213

Anyone interested in using this latest PR Code, then you can download the patch & lever it via your composer.

john_a’s picture

Hi gobinathm,

I've found an issue with the D9 patch:

TypeError: Argument 1 passed to Drupal\brightcove\Form\BrightcoveVideoPlaylistForm::__construct() must be an instance of Drupal\Core\Entity\EntityTypeBundleInfo,
instance of Drupal\Core\Entity\EntityManager given, called in /var/www/adg/docroot/modules/contrib/brightcove/src/Form/BrightcoveVideoPlaylistForm.php on line 45 in Drupal\brightcove\Form\BrightcoveVideoPlaylistForm->__construct() (line 34 of modules/contrib/brightcove/src/Form/BrightcoveVideoPlaylistForm.php).

This occurred while I was testing the patch locally, and edited a video.

I'm looking into an update to the patch now.

serious unicorn’s picture

I have applied the patch, but i still getting the error like in #18

pedrosancao’s picture

Updated patch #14 to fix the error below using an use statement.

Error: Class 'Drupal\brightcove\Entity\NodeInterface' not found in Drupal\brightcove\Entity\BrightcoveVideoPlaylistCmsEntity->setPublished()

mjt772’s picture

I'm encountering the same problem, I think, that @hidabe mentioned in #10. The brightcove composer.json requires drupal/time_formatter ^1.0, even though we need to be using 2.0.x-dev@dev. Specifying the latter in the root composer.json causes composer to throw an error on update, of course:

Root composer.json requires drupal/time_formatter 2.0.x-dev@dev, ^1.0, found drupal/time_formatter[dev-1.x, dev-2.0.x, 1.0.0, 1.x-dev (alias of dev-1.x), 2.0.x-dev (alias of dev-2.0.x)] but it does not match the constraint.

So it seems to me that it needs to be changed in the brightcove composer.json. Does this need to be patched, or am I the only one still experiencing this?

*Editing to correct myself: This isn't something that can be patched; since this is a change to a composer-moderated dependency in a composer.json file, any attempt to fix this in a patch will be ignored by composer; the fix needs to be made directly to the project code.

douggreen made their first commit to this issue’s fork.

rescandon made their first commit to this issue’s fork.

yce’s picture

Status: Needs review » Fixed

Closing ticket as it is already solved by https://git.drupalcode.org/project/brightcove/-/merge_requests/11 (and 12, 13)

Status: Fixed » Closed (fixed)

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