Closed (fixed)
Project:
Crop API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Oct 2017 at 15:42 UTC
Updated:
1 Feb 2018 at 15:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
woprrr commentedHere two patches, for 1.x branch (Rétro compatible with Media Entity) and 2.x fully compatible with Media.
Comment #5
phenaproximaI reviewed the 1.x patch and found several issues:
&$form should be type hinted as an array.
Should be "media type form".
&$form should have the array type hint.
Nit: The else { should be on a new line.
&$form should be type hinted as an array.
s/media/Media
Wait, what? Config entities don't have bundles. Why are we loading $entity->bundle() if $entity is a media type?
else { should be on its own line.
Comment #6
woprrr commentedHere you are 1.x fixes and some coding standards fixes by the way...
Comment #8
woprrr commentedThis way is better and reduce general complexity.
As discussed with @slashrsm
I maintain that provider and permit this method can retrieve $entity_type from ContentEntityType. We can't retrieve directly the Entity Type loaded directly we need to use EntityManager to do that.
Comment #9
woprrr commentedTypo/Nit/coding standards fixes backported onto 2-x patch and change backported for \Drupal\crop\Plugin\Crop\EntityProvider\Media::uri
To test providers here small code to past in devel console :
Comment #10
woprrr commentedBackport of https://www.drupal.org/node/2808719#comment-12314321 change for 2.x branch to assume empty value for crop configuration form.
Comment #11
woprrr commentedRe-roll of patch for 1.x branch and small addition to display element in correct form element group.
Small addition of form element group for 2.x patch.
Everything look's good 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 ?
Comment #13
woprrr commentedComment #14
woprrr commentedRe-roll patches head of last release (1.x) / beta-1 (2.x)
Comment #15
phenaproximaI don't think you can directly use Media's classes unless you have a hard dependency on core Media...no?
Comment #16
woprrr commented@phenaproxima :O I'm surprised I didn't see this change in patches ! This look like a custom check I have added to debug in my test install but does not appear here :O We are right this doesn't applied at all But with patches apply I didn't see
Comment #17
woprrr commentedThis check only exist on _crop_media_provider_form() function and that's only fired if we use Media entity of Media in core Both module implement same form_alter() and we need to be sure what entity builder you should process. If current media are MediaType then First condition are OK else we are in Media entity context.
This form_alter does not create a strong dependency to media entity / media core but this is only a way to avoid code duplications in 1.x branch. We need to permit using Media Entity Or Media core.
Perhaps this opportunity to bring both lives to you and you prefer a more radical approach? In this case the addition of a conflict in the composer.json would not hurt to empower users to the fact that 1.x === Media entity 2.x === Media in core?
Comment #18
balsamaThe patch in #14 won't apply to the D.O packaged version of 8.x-2.x-beta1 because it patches the crop.info.yml file, and file differs in the packaged version since D.O adds some stuff. So if you want to use the patch in a project, you need to HEAD of 8.x-2.x which isn't modified by D.O.
Here's a patch that's identical to #14, but assumes the info file has been modified by D.O.
This is not relevant to the actual issue at hand. Do not test.
Comment #19
woprrr commentedHi @balsama,
Now Lightning seems using this patch during 6 days without problems :) That's sound good to this patch to be merged in 2.x !
As we have discussed on Slack, new Image Widget Crop requirements does work to use dev branch and apply patch normally now.
I switch that RTBC if anyone have objections :)
Comment #22
woprrr commentedMerged Thanks all :) good job @balsama I will create PR onto Lightning as we have seen in slack.
Comment #23
abaier commentedSince crop_media_entity was removed from the modules here, we got an update issue and get warnings:
Dependency issue when upgrading from 1.3.0 to 1.4.0
Comment #24
lukusI'm seeing the same warning as @ABaier.