TypeError on EmbedCodeUrlBuilder on new revision update for an existing asset/image on Acquia DAM

Created on 17 January 2025, 3 months ago

Problem/Motivation

On updating a new version for an image/asset on Acquia DAM, the drupal cron run produces the following error:

[error] TypeError: Drupal\acquia_dam\EmbedCodeUrlBuilder::getDimensionValue(): Argument #1 ($number) must be of type int, null given, called in /var/www/html/docroot/modules/contrib/acquia_dam/src/EmbedCodeUrlBuilder.php on line 135 in Drupal\acquia_dam\EmbedCodeUrlBuilder::getDimensionValue() (line 196 of /var/www/html/docroot/modules/contrib/acquia_dam/src/EmbedCodeUrlBuilder.php) #0 /var/www/html/docroot/modules/contrib/acquia_dam/src/EmbedCodeUrlBuilder.php(135): Drupal\acquia_dam\EmbedCodeUrlBuilder::getDimensionValue()
#1 /var/www/html/docroot/modules/contrib/acquia_dam/src/StreamWrapper/AcquiaDamStreamWrapper.php(416): Drupal\acquia_dam\EmbedCodeUrlBuilder::mapImageEffects()
#2 /var/www/html/docroot/modules/contrib/acquia_dam/src/StreamWrapper/AcquiaDamStreamWrapper.php(322): Drupal\acquia_dam\StreamWrapper\AcquiaDamStreamWrapper->loadAsset()
#3 /var/www/html/docroot/modules/contrib/acquia_dam/src/Plugin/Field/FieldType/ComputedEmbedCodes.php(54): Drupal\acquia_dam\StreamWrapper\AcquiaDamStreamWrapper->getExternalUrl()
#4 /var/www/html/docroot/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php(34): Drupal\acquia_dam\Plugin\Field\FieldType\ComputedEmbedCodes->computeValue()
#5 /var/www/html/docroot/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php(43): Drupal\acquia_dam\Plugin\Field\FieldType\ComputedEmbedCodes->ensureComputedValue()
#6 /var/www/html/docroot/modules/contrib/ckeditor_mentions/src/MentionEventDispatcher.php(91): Drupal\acquia_dam\Plugin\Field\FieldType\ComputedEmbedCodes->getValue()
#7 /var/www/html/docroot/modules/contrib/ckeditor_mentions/src/MentionEventDispatcher.php(48): Drupal\ckeditor_mentions\MentionEventDispatcher->getMentionsFromEntity()
#8 /var/www/html/docroot/modules/contrib/ckeditor_mentions/ckeditor_mentions.module(17): Drupal\ckeditor_mentions\MentionEventDispatcher->dispatchMentionEvent()
#9 [internal function]: ckeditor_mentions_entity_update()

Steps to reproduce

  1. Upload a revision to image/asset in Acquia DAM.
  2. Run Cron on Drupal Backend to sync the Acquia DAM new updates on Drupal
  3. It results in a TypeError

Proposed resolution

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India shubhamgoel Delhi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @shubhamgoel
  • 🇮🇳India shubhamgoel Delhi

    Hi ,

    Just uploaded a patch for the resolution for this issue.

  • Pipeline finished with Success
    3 months ago
    Total: 2002s
    #398499
  • Pipeline finished with Success
    2 months ago
    Total: 1877s
    #409483
  • Issue was unassigned.
  • Status changed to Needs review 6 days ago
  • 🇺🇸United States DamienMcKenna NH, USA

    Thank you for reporting the bug and providing a merge request, hopefully some folk will be able to test this and work towards committing a fix.

    As a reminder, please set the "Assigned" field to "Unassigned" after you're finished with your work - attribution/credit for issues is tracked separately. Thank you.

  • 🇺🇸United States jds1 Hudson Valley, NY

    Setting priority to critical. This issue brought down a site in production inexplicably. Have not been able to repro on any other environments or locally so far. Planning to patch but won't be able to verify until code rolls to prod. If I can verify this patch fixes the issue I can mark RTBC.

  • 🇮🇳India rajeshreeputra Pune

    Could you please try updating to 1.1.0 version. Thank you!

  • 🇺🇸United States jds1 Hudson Valley, NY

    Thank you for cutting a new version! I am now no longer able to repro on our prod site (without having updated this new version – we're on the same codebase as Friday when the issue occurred) but I'll confirm again once we have this in prod (or if something changes) and we can get this issue closed out.

Production build 0.71.5 2024