Content parsing broken

Created on 13 October 2023, 9 months ago
Updated 17 October 2023, 8 months ago

Problem/Motivation

With content parsing selected, I'm not seeing file type or size being appended to link text. However, I can see the file type and size on links from fields.

Steps to reproduce

1. Enable module.
2. Head to "/admin/config/media/media_link_enhancements".
3. Enable "Type/size appending" for at least one media type.
4. Enable "Redirection" for the same media type you enabled type/size appending.
5. Enable "Content parsing" for the field type where you will be adding media links.
6. Create a node with a link to media. Currently, I am using CKE5 with the standard link button that integrates with the LinkIt module.
7. After saving, the file type and size are not appended to the link text.

Proposed resolution

Update line #152 of "MediaLinkEnhancementsAlterLinks.php" to

      // Get the full link to replace before we modify it.
      $full_link = $doc->saveHTML($link);
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States afinnarn

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

Comments & Activities

  • Issue created by @afinnarn
  • @afinnarn opened merge request.
  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States afinnarn

    I'm used to adding patches, but hopefully, I did the MR workflow correctly.

    I also added a .gitignore for IntelliJ files since many Drupal contributors use PHPStorm (including me) and we'd have to ignore those files with every contribution.

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States afinnarn

    Un-assigning myself so someone else can review.

  • πŸ‡ΊπŸ‡ΈUnited States cameron prince

    The change looks good and has been merged. This is my first time using the merge request way. I your code change has made its way to the dev branch, but not sure if I need to do more to credit you.

  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cameron prince
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024