Over the past two months I have gradually updated one of my Lightning projects. Since the integration of media into Core, this process has become more difficult. Since the release of Drupal 8.5, and Lightning 3.1.0, I've encountered a problem I can't solve.
With 8.5/3.1.0 the Lightning Media Image Entity is dropped. The direct update from Drupal 8.4.5/2.2.0 to the current version fails because in this way there is no migration from Lightning Media Image Entity to Media in Core.
To solve the problem I followed the procedure described on https://github.com/acquia/lightning/releases?after=2.2.4. In particular I have been executing the steps in the section "2.2.0 to 2.2.1 Manual Update Steps" one after the other.
Unfortunately, this leads to the following error message, which is caused by a dependency defined in the Lightning installation.
$ drush cr
$ drush updatedb
[error] This branch of Entity Browser is not compatible with the version of Media Entity installed. (Currently using Entity Browser This branch of Entity Browser is not compatible with the version of Media Entity installed.) Finally, I tried https://lightning.acquia.com/blog/lightning-strict, which leads to the same error message with the difference that the underlying installation corresponds to the original at the time of its release.
Why does the dependency on Media Entity cause a problem if it is part of the distribution? And what would be a viable solution to step up to 8.5/3.1.0, which to date is the actual release of Lightning?
Comments
Comment #2
Ralf Eisler commentedI went back to Lightning 2.2.0 with all patches applied properly and reinstalled the backup-database:
$ composer require acquia/lightning:2.2.0 balsama/lightning_strict:2.2.0 --no-update$ drush cr$ drush sql-cli < my_database.sql$ drush updatedbThe installation was okay with no errors.
Then I installed Lightning 2.2.1 with all patches applied properly:
$ composer require acquia/lightning:2.2.1 balsama/lightning_strict:2.2.1 --no-update$ drush cr$ drush updatedbComment #3
frederickjhI ran into this same error message while doing the same Lightning upgrade from 2.2.0 to 2.2.1.
Not sure if this is in the documentation anywhere but I figured out that I had a number of Lighting required packages also in my root composer.json. When running
composer updateorcomposer require vendor/packageI would get warning messages like:> Dependency vendor/package is also a root requirement, but is not explicitly whitelisted. Ignoring.
Once I manually edited and removed these packages and their version constraints from my main composer.json I was able to upgrade from Lightning 2.2.0 => 2.2.2 with
I am using the Lightning Strict package for my upgrades.
You may notice that I decided to got directly to the 2.2.2 release instead of upgrading to the 2.2.1. I did this as the notes in UPDATE.md were the same and I figure that it was most likely because it was a bug fix.
I hope this helps someone else having this issue.
Comment #4
frederickjhOne further note, I notice that one of the database updates listed for upgrading from 2.2.0 => 2.2.0 did not run. This was the
lightning_api module :
8002 - Installs the Consumers module.
The consumers module was not installed but required by lightning. I fixed this with
Comment #5
Ralf Eisler commentedI came to the same conclusion, and in fact, I had some requirements in the root composer.json file, which were identical to some requirements in the composer.json file in the Lightning profile. So I removed them from the root file.
I also did that, but this update failed:
I tried differend ways to go up from 2.2.0 to 2.2.1 to 2.2.2. I always end up with the same error message:
Comment #6
Ralf Eisler commentedI upgraded to 2.2.5, wich solved the issue dropzonejs_eb_widget_update_8101.
But still no solution for the replacement of the Media Entity with Media.
As a result, Media is not activated and Media Entity is not deactivated.
Comment #7
frederickjhHi @Thomas Factory!
Looking at your shell output above I have to wonder if you have uninstalled the Lightning Workflow module. At the upgrade to 2.2.4 Lightning Workflow will be updated to use core Workflows and Content moderation modules and existing sites will be migrated.
You may need to enable Lightning Workflow do the upgrade, then uninstall it.
One other interesting note that may be related to your missing field that I found in the github release notes under, 2.2.1 to 2.2.2 Manual Update Steps in the following:
Thanks for your help!
Frederick
Comment #8
Ralf Eisler commentedHello @frederickjh
In my recent project, I have straight forward editing processes. Therefore, I don’t need Workflows. In my installation, Lightning Workflow is activated, Content Moderation an Workflows are not. As I can recall of my previous shell outputs, the update of Lightning Workflow to Core went smoothly.
Despite of the ongoing problem updating the database, I stepped up to "acquia/lightning": "2.2.7". Then looking to the list of my modules, I noticed, that Media Entity Image was deactivated, but not Media Entity Document. I could however deactivate Media Entity Document and remove the two modules from the modules folder. I have now a functioning website, with working media editing, but I cannot update the database.
drush updatedb
/update.php
The following updates returned messages:
media_entity module
drush media-entity-check-upgrade
[error] Error: Call to undefined function Drupal\media_entity\Commands\drush_bootstrap_to_phase() in Drupal\media_entity\Commands\DrushCommands->mediaEntityCheckUpgrade() (line 40 of /home/myproject/www/update.myproject.com/docroot/modules/contrib/media_entity/src/Commands/DrushCommands.php)So I looked for:
/project/media_entity/issues/2925498
Applied patch from this thread and:
drush mecu
I deactivated Media Entity 2.x and removed it from the modules folder.
drush cr
drush updatedb
So, success updating the database, finally. I did this on a copy of the project. I will redo the process again from 2.2.0 and will try to go further from 2.2.7 to 3.1.0.
Thank you for you help!
Comment #9
phenaproximaComment #10
phenaproximaThis issue has not seen any action in over 3 years, and refers to old versions of modules Lightning Media no longer includes or uses in any way. Therefore, I think it's time to close this out :)