πŸ‡ΊπŸ‡¦Ukraine @KateKarpenko

Kyiv
Account created on 8 November 2021, over 2 years ago
#

Recent comments

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

#10 and #9 in their combination worked for me great, thanks!

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Our team encountered this issue after upgrading to d10 and the latest versions of modules. If downgrade versions for two modules it will still work though.

Using these versions:
"drupal/layout_paragraphs": "2.0.3", "drupal/layout_section_classes": "1.3"

Instead of:
"drupal/layout_paragraphs": "2.0.4", "drupal/layout_section_classes": "1.4"

makes it work.

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

I had the same issue as mentioned in #7 and #4 was very helpful and fixed it for me

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Hi everyone,
I experience the same issue.

I configure it on the manage form display page to show some fields in a table, but on the edit form page table renders as empty and all fields are outside the table.

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Awesome, thanks a lot, I've got it working!
That's definitely what I need.

Big thanks to DrDam for the quick response and support.

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Thank you, I upgraded to the new version already and cleared the cache.

I've got a new error

Fatal error: Class Drupal\media_contextual_crop_embed\Plugin\MediaContextualCropUseCase\Embed contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\media_contextual_crop\MediaContextualCropUseCaseInterface::getContextualUri) in /project/web/modules/contrib/media_contextual_crop_embed/src/Plugin/MediaContextualCropUseCase/Embed.php on line 17

and I still see that patch cannot be applied

  - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2022-10-10/patch_media_lib.patch (Add multi_crop_embed filter as managing media_embed)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-10-10/patch_media_lib.patch

Could you fix it, please?

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Well, I reinstalled Image Widget Crop β†’ and Crop β†’ modules, and for now image cropping styles are working with media field (as entity reference to media).

But when I try to change the crop for the image (which is the field "media with contextual") - it still uses crop from the original image cropping while rendering on a page, and when I go to the edit form page I can assure that contextual crop is saved.

What do I need to do for having this contextual cropping on the front as well?

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Good point! Thanks!

I re-installed again all Contextual Crop Ecosystem and all patches are applied correctly except for one

https://www.drupal.org/files/issues/2022-10-10/patch_media_lib.patch (Add multi_crop_embed filter as managing media_embed)
 Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-10-10/patch_media_lib.patch

but as I see it's for embedded media... not exactly my case...

And I still have an issue with "crop image style" not rendering on the front

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Well, applying a patch on media_library_media_modify

  "Issue #3263397-10: Simplify form logic in media library" =>  "https://www.drupal.org/files/issues/2023-01-19/3263397-16.patch"

resolved that error! Thank you!!!

About the cropping issue - here are my steps:

1. Created Crop type 16:3
2. Created Image Style Crop 16:3
3. Created CT with field as Reference/media with contextual modifications - entity reference to media type Image
4. On "manage form display for CT" I see for the field "media library extra" widget with next settings:

 Multi edit form on create: true
No edit form on create: false
Check selected: true
Replace checkbox by order indicator: true
Form mode: default

5. On manage display tab for CT - I set format for the field "rendered entity" rendered as "Test mode"
6. Then on Media Type Image - on " manage form display" I set for image ImageWidget crop with next settings

ImageWidget crop
Always expand crop area: Yes
Show default crop area: Yes
Warn the user if the crop is used more than once: Yes
Preview image style: large
Preview crop zone image style: Crop thumbnail
Crop Type used: crop_16_3

7. On "manage display" tab I went to the viewmode "Test mode" and set Image as Image format with

Image style: Crop style 16:3
Image loading: lazy

8. Created Test page and put an image from media library with contextual ALT text and crop.
9. Saved it and went to dev tools and saw that image style should be applied correctly, but on the page image is rendering on original size

<img src="/sites/default/files/styles/crop_style_16_3/public/2023-05/tokyo-office.jpg?itok=82jO_v-c" width="4721" height="5115" alt="initial alt text 111111" loading="lazy" typeof="foaf:Image">

πŸ‡ΊπŸ‡¦Ukraine KateKarpenko Kyiv

Thank you DrDam for your quick reply!
And yep - updating to 1.1.1v got it worked.
Now my media library is not breaking, but I have another issue and am unsure which topic it should be.

In Content-Type I'm using the field as "Reference/media with contextual modifications" and when I try to use any picture while creating a page I see an error message

Error message
Warning: Undefined variable $original_delta in Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget->formElement() (line 425 of core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php).
Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget->formElement(Object, 0, Array, Array, Object) (Line: 171)
Drupal\media_library_media_modify\Plugin\Field\FieldWidget\MediaLibraryWithOverrideWidget->formElement(Object, 0, Array, Array, Object) (Line: 353)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 92)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object, NULL) (Line: 286)
Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget->form(Object, Array, Object) (Line: 183)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 534)
Drupal\Core\Form\FormBuilder->retrieveForm('node_test_ct_edit_form', Object) (Line: 281)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 707)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I use multi_crop_field_formatter with media_contextual_crop_iwc_adapter because I need image_widget_crop.

I did all settings of Crop type & Image styling using this crop type and everything did according to the docs β†’

On the edit page form, I can see as it was announced in the doc - the possibility to adjust alt-text and crop for contextual use. After saving the page in the dev tool panel, I inspected the image element. ALT text is applied only for specific node without affecting the original image in the media library as it was expected, but cropping is not applied at all. unfortunately

Production build 0.69.0 2024