Here is the setup:
1- Install varbase.
3- Add basic page.
2- Add a gallery from WYSIWYG.
4- Save.
3- Notice: Undefined index: ratio in Drupal\blazy\BlazyFormatter->preBuildElements() (line 113 of modules/contrib/blazy/src/BlazyFormatter.php).
Drupal\blazy\BlazyFormatter->preBuildElements(Array, Object, Array) (Line: 32)
Drupal\slick\SlickFormatter->preBuildElements(Array, Object, Array) (Line: 25)
Drupal\slick\Plugin\Field\FieldFormatter\SlickMediaFormatter->commonViewElements(Object, 'en', Array) (Line: 45)
Drupal\slick\Plugin\Field\FieldFormatter\SlickMediaFormatter->viewElements(Object, 'en') (Line: 89)
Drupal\Core\Field\FormatterBase->view(Object, 'en') (Line: 76)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL) (Line: 263)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 267)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 351)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 293)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 250)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 212)
Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter->Drupal\entity_embed\Plugin\Filter\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 213)
Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter->process('
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 62)
Drupal\text\TextProcessed->getValue() (Line: 140)
Drupal\Core\Field\FieldItemBase->__get('processed') (Line: 139)
node_tokens('node', Array, Array, Array, Object)
call_user_func_array('node_tokens', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 304)
Drupal\Core\Utility\Token->generate('node', Array, Array, Array, Object) (Line: 196)
Drupal\Core\Utility\Token->replace('[node:summary]', Array, Array, Object) (Line: 66)
Drupal\metatag\MetatagToken->replace('[node:summary]', Array, Array) (Line: 553)
Drupal\metatag\MetatagManager->generateRawElements(Array, Object) (Line: 475)
Drupal\metatag\MetatagManager->generateElements(Array, Object) (Line: 496)
metatag_get_tags_from_route() (Line: 265)
_metatag_remove_duplicate_entity_tags(Array) (Line: 234)
metatag_entity_view_alter(Array, Object, Object) (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('node_view', Array, Object, Object) (Line: 316)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 250)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

CommentFileSizeAuthor
#7 3174660-7.patch806 bytesRajab Natshah
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

qusai taha created an issue. See original summary.

Qusai Taha’s picture

Qusai Taha’s picture

Fixed it after apply patch #2 from
https://www.drupal.org/project/blazy/issues/3174661

Qusai Taha’s picture

Title: Notice: undefined index ratio in blazy when try to adding images from gallery in WYIWYG » Notice: undefined index ratio in blazy when try to adding images from gallery in WYSIWYG
Rajab Natshah’s picture

Title: Notice: undefined index ratio in blazy when try to adding images from gallery in WYSIWYG » Fix Notice: undefined index ratio in blazy when try to adding images from gallery in WYSIWYG
Rajab Natshah’s picture

Assigned: Unassigned » Rajab Natshah
Status: Active » Needs review
Rajab Natshah’s picture

FileSize
806 bytes

Thank you Qusai for reporting
and the patch in #3174661: Fix notice: undefined index ratio by check the value if not empty
You can add a patch to add your patch for other projects
as you can see in the following attached patch

The Gallery media type is a custom Varbase Media type.
more info in the Blazy module for maintainers to know the steps to reproduce
The Gallery media type is a media entity which references to other media types ( Image, local video, remote video)

Rajab Natshah’s picture

Title: Fix Notice: undefined index ratio in blazy when try to adding images from gallery in WYSIWYG » Fix Notice: undefined index ratio in Blazy when try to adding images from Gallery media type in WYSIWYG

Rajab Natshah’s picture

Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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