When upgrading from 1.3.0 to 1.4.0 via composer there is a missing module `crop_media_entity` on the latest release.
Could we add documentation on the module to manually remove this module from core.extension.yml?

CommentFileSizeAuthor
#12 2937337-12.patch1.18 KBwoprrr
#8 2937337-8.patch951 byteswoprrr
#7 2937337-6.patch951 byteswoprrr

Comments

jozzy_a created an issue. See original summary.

abaier’s picture

I am experiencing the same warnings after updating with drush up.

User warning: The following module is missing from the file system: crop_media_entity in drupal_get_filename() (line 250 of core/includes/bootstrap.inc)
jozzy_a’s picture

The fix I used was remove it from the core.extension.yml and run the following drush command `drush sql-query "DELETE FROM key_value WHERE collection='system.schema' AND name='crop_media_entity';"`

abaier’s picture

Thanks, I thought about that too. But before deploying this I would like to hear if there would be a way to cleanly apply the update.

I also got this in the console:

include_once(/Applications/MAMP/htdocs/my_project/htdocs/modules/crop/modules/crop_media_entity/crop_media_entity.module): failed to open stream: No such file or directory Extension.php:140 [warning]
include_once(): Failed opening '/Applications/MAMP/htdocs/my_project/htdocs/modules/crop/modules/crop_media_entity/crop_media_entity.module' for inclusion            
(include_path='.:/Applications/MAMP/bin/php/php7.0.22/lib/php') Extension.php:140 [warning]
anybody’s picture

Same problem here. I'm waiting for a solution within the module before hacking anything manually now.

abaier’s picture

I finally uninstalled crop_media_entity first and did the update to crop 1.4.0 afterwards. Worked without errors and hopefully I did not lose any data. But looks good.

woprrr’s picture

Status: Active » Needs review
StatusFileSize
new951 bytes

Hi there,

Oh god ! Lot of people seem's to installed this deprecated sub-module.

To recontextualize the problem with this sub-module read :

In that provider the idea was that you could have crops that are tied to different entities. This way you could say for node N crop like this and for node M like this but then we realized that the image style system can't do that so it was a good idea I guess but can't be used right now.

Edit : @phenaproxima : I have juste one doubt about move submodule into crop basis for Media cropProvider "modules/crop_media_entity/src/Plugin/Crop/EntityProvider/MediaEntity.php" If users have this module enabled we need to add update_n to uninstall "crop_media_entity" on update no ?

During developpements I have pointed this fact but we have think anybody enabled this deprecated module and upgrade tests we have tested with Crop API only and not with that module enabled it's my bad sorry for noise !

Here a patch to solve the problems for people using this module.

woprrr’s picture

StatusFileSize
new951 bytes

Small adjust.

anybody’s picture

Title: Dependency issue when upgrading from 1.3.0 to 1.4.0 » crop_media_entity dependency issue when upgrading from 1.3.0 to 1.4.0
anybody’s picture

Status: Needs review » Reviewed & tested by the community

Thank you very much. It would be very helpful to have this commited to the latest version (incl. stable) to prevent others from a manual patch.

woprrr’s picture

I just wait feedback about others and make another release to fix that this morning ;)

woprrr’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.18 KB

@Anybody Thank for your previous fast review :) I just need to improve more and be sure this kind of problems or others possible are avoided. After small discuss with @Berdir about deprecated modules strategy we have pointed the example of entity_reference example seem's the best way to do that more cleany/easy.

It's possible to test that patch works cleany for all and then I can merge it fast today.

anybody’s picture

Thank you very much. I didn't know that the possibility for an uninstall via service in a hook exists in D8. Perfect! Have you tested that the hook always runs before the module "crop_media_entity" doesn't exist anymore? Or isn't that a problem?

woprrr’s picture

Status: Needs review » Reviewed & tested by the community

This isn't a problem because when you apply patch the minimum are here 'info.yml' and then update_n works to uninstall all trace of that module properly (it's better for your system stability than use database ;)).

All my tests are good to me I think we can merge arround 11PM

  • woprrr committed 09b1221 on 8.x-1.x
    Issue #2937337 by woprrr, Anybody: crop_media_entity dependency issue...
woprrr’s picture

Status: Reviewed & tested by the community » Fixed

Merged. Thank all and @Anybody for tests/reactivity ;)

les lim’s picture

Status: Fixed » Patch (to be ported)

@woprr, it looks like you committed the patch in #8, but not the one in #12. Was that intentional?

Also, this still needs to be ported to the 8.x-2.x branch for people upgrading Drupal Core to 8.4.x.

lukus’s picture

+1 for committing this to 8.x-2.x branch.

woprrr’s picture

Hi there, Yes it's intentional because 2.x branch are a support branch for Media Core and that assume all media_entity reliquat are deleted. IMHO it's a good idea because that force people to use 1.4 before switch 2.x and prepare correctly media_entity upgrade. What's you feeling about that ? you think this does added in 2.x first release and delete it in 2.1 later ?

Also, this still needs to be ported to the 8.x-2.x branch for people upgrading Drupal Core to 8.4.x.

Not necessary if you still use media_entity but you can upgrade 1.4 first (stable) and after prepare your migrate with 2.x and use it for Media Core.

les lim’s picture

IMHO it's a good idea because that force people to use 1.4 before switch 2.x and prepare correctly media_entity upgrade.

Two arguments to that:

1. People don't know that they need to first upgrade to 1.4, and nothing actually prevents them from attempting to go to 2.x straight from 1.3 or before. That's why we preserve all hook_update_N() functions in the .install file across major versions.
2. If something goes wrong in the 2.x upgrade, then the system schema_version will refer to a hook_update_N() function that doesn't exist anymore. Not a huge deal, but potentially alarming to someone who is troubleshooting a broken upgrade.

jcnventura’s picture

Indeed, this MUST be in the 2.x branch. Two more reasons:

3. Imagine that you forget to skip 8003 in the 2.x branch, and create a 2.x-specific crop_update_8003(). Anyone updating from 1.4 will not get the update. If you believe you'll never forget this.. You've just made this module have a bus factor of 1.
4. Some of us (all, maybe...) are now going through the motions of disabling media_entity and adding support for core media. This module is one of those that should be updated to version 2. I have a site where we'll jump from version 1.0 to 2.0 without ever running 1.4. I can certainly do it in several steps, and the exported config from these steps should indeed disable the module. But there are workflows out there where composer will just replace the versions, and because people don't want to overwrite live's config, "drush updb" will be executed on the live server - that never had a version 1.4.

So add the hook_update_8003 to the 2.x branch asap, please :)

spokje’s picture

Oops. nevermind.

henrijs.seso’s picture

Version: 8.x-1.4 » 8.x-2.x-dev

This must be primarily in 2.x branch. Just jumped from 1.2 to 2.0 and wasted a day. It applies cleanly and works for 2.x-dev and should be merged sooner. Also needs backport to 1.x branch.

  • woprrr committed 11990fa on 8.x-2.x
    Issue #2937337 by woprrr, Les Lim, lukus, mansspams, jcnventura:...
woprrr’s picture

Status: Patch (to be ported) » Fixed

Come back to Crop ecosytem modules !!! Sorry for delay >-< Lot of media things...

The patch are now backported onto 8.2.x ! The next release as 8.2.0 will force all users to migrate and apply the update_8004() to delete definitively all traces of this deprecated module. We can foresee a deletion of the sub-module definitively for the release 8.2.5 (arround).

jcnventura’s picture

Nice! It would have been better to have had it called crop_update_8003 also in the 8.x-2.x branch, but no harm done.

Also for future reference, the hook_update_n documentation recommends that these would be:

  • mymodule_update_8201(): The first update for the 8.x-2.x versions.

Status: Fixed » Closed (fixed)

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