Account created on 31 August 2022, about 2 years ago
#

Merge Requests

Recent comments

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

I’ve committed a change to address the PHP fatal error caused by Viewfield arguments with whitespace. This update sanitizes existing arguments by trimming spaces in ViewfieldFormatterDefault->processArguments. As a result, the error we were seeing when content editors added arguments with spaces in Viewfield -Arguments is resolved.

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

I think I found what is happening. The OptionsWidgetBase::validateElement method fails to correctly set the $form_state for moderation_state. This causes issues in ModerationStateFieldItemList->updateModeratedEntity, preventing the detection of moderation state changes. Consequently, this leads to downstream issues with pathauto. I've created MR 16 adding WorkflowButtonsWidget::validateElement.

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

I'm running out of time and want to share findings after spending much of today debugging problem I'm thinking is related to this issue. When adding adding a menu link to an existing Node the following error is throw

Drupal\Core\Entity\EntityStorageException: Plugin ID 'menu_link_content:8a547baa-d9f5-458b-9cc7-939e642f78db' was not found. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

EntityFormDisplay->extractFormValues->getRenderer
WorkflowButtonsWidget->extractFormValues($items, $form, $form_state) - $entity->isDefaultRevision() stays FALSE
vs
ModerationStateWidget->extractFormValues($items, $form, $form_state) - $entity->isDefaultRevision() changes TRUE

In ModerationStateFieldItemList->updateModeratedEntity (line 167)
$entity->isDefaultRevision($update_default_revision);

From my testing it's this Node->isDefaultRevision() FALSE that is causing the issue with menu_link_content postSave

Got to run but I believe there is something different between to WorkflowButtonsWidget and ModerationStateWidget at the heart of this issue.

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

I spent an entire day with the debugger trying to find an elegant solution to this issue. My conclusion is that LayoutBuilder InlineBlock, by adding the Reusable property to BlockContentEntity, creates a separation of concerns problem. This approach couples BlockContent to LayoutBuilder in ways that other modules, like MediaLibrary, shouldn't have to worry about. I've started considering extending BlockContentEntity for InlineBlock as a potential path toward a solution.

Unable to come up with a quick solution, I pivoted back to the workaround for Drupal 10.2.6
https://git.drupalcode.org/issue/drupal-3106315/-/compare/11.x...3106315...

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

I think I added the suggested test. Forgive the extra commits I was unable to get failing tests with DrupalPod.

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

My name is Ian and I'm working today on this issue at DrupalCon 2024

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

@rec.barkdoll #8 seems to work for me in Drupal 10.2.x I've added a check to prevent warning with other media types (i.e document).

my_module.module

/**
 * Implements hook_ENTITY_TYPE_presave().
 */
function my_module_media_presave(EntityInterface $entity): void {
  /** @var \Drupal\media\Entity\Media $entity */
  if ($entity->bundle() === 'image'
    && $entity->hasField('thumbnail')
    && $entity->hasField('field_media_image')
  ) {
    $entity->thumbnail->alt = $entity->field_media_image->alt;
  }
}
πŸ‡ΊπŸ‡ΈUnited States ian.ssu

Is this project still maintained?
Drupal 9 EOL is 11/1/23

πŸ‡ΊπŸ‡ΈUnited States ian.ssu

+1 for increasing to 120 lines. The core source does not appear to be hindered by this excessively strict rule.

Echo above from @ChrisSnyder question: What needs to happen to get movement on this issue?

Production build 0.71.5 2024