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:
- 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.
- 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.
- 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
- Apply the patch in the comment by Project Update Bot
- 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
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:
- 3146320-D9-compatibility
changes, plain diff MR !2
- 8.x-2.x
changes, plain diff MR !4
- 3146320-automated-drupal-9
changes, plain diff MR !3
Comments
Comment #2
project update bot commentedThis 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.ymlfile 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
This patch was created using these packages:
Comment #3
gobinathmThere are other issue on this module apart from the once autofixed by Rector
Comment #4
byrond commentedThis 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.
Comment #5
byrond commentedRemoving the bot tag, since we're doing this manually. Feel free to add it back if needed.
Comment #7
gobinathmOnly Open issue after the Merge Request
Comment #8
kerasai commentedHi 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 requiredrupal/inline_entity_formas well, but I already had it. These two dependencies should be declared in the maincomposer.jsonfor 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_entitywhich 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!
Comment #9
kerasai commentedHi 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!
Comment #10
hidabe commentedSame 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 :(
Comment #11
bhanu951 commentedFor 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/brightcoveComment #12
tushar1 commentedUpdated patch #11 with removing Core:8.x from info.yml files
Comment #13
drewble commentedPatch #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.
Comment #14
Ravi_3596 commentedPatch #13 applied successfully.
Comment #18
Aliaksandr Muraveiko commentedHi 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.
Comment #19
Aliaksandr Muraveiko commentedComment #20
Aliaksandr Muraveiko commentedUpdated patch #13 to fix the https://www.drupal.org/project/brightcove/issues/3146320#comment-14077776 issue
Comment #21
Aliaksandr Muraveiko commentedComment #22
gobinathmThis 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.

Comment #23
john_a commentedHi gobinathm,
I've found an issue with the D9 patch:
This occurred while I was testing the patch locally, and edited a video.
I'm looking into an update to the patch now.
Comment #24
serious unicorn commentedI have applied the patch, but i still getting the error like in #18
Comment #25
pedrosancao commentedUpdated patch #14 to fix the error below using an
usestatement.Error: Class 'Drupal\brightcove\Entity\NodeInterface' not found in Drupal\brightcove\Entity\BrightcoveVideoPlaylistCmsEntity->setPublished()Comment #26
mjt772 commentedI'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 using2.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.
Comment #29
yce commentedClosing ticket as it is already solved by https://git.drupalcode.org/project/brightcove/-/merge_requests/11 (and 12, 13)