Skip to content

RTE Link Picker: Fix media selection to allow items not permitted at root.#21678

Merged
nielslyngsoe merged 4 commits intomainfrom
v17/bugfix/rte-link-picker-media-filter
Feb 19, 2026
Merged

RTE Link Picker: Fix media selection to allow items not permitted at root.#21678
nielslyngsoe merged 4 commits intomainfrom
v17/bugfix/rte-link-picker-media-filter

Conversation

@engijlr
Copy link
Copy Markdown
Contributor

@engijlr engijlr commented Feb 9, 2026

Summary

  • Fixed an issue where the RTE link picker only allowed selecting media items whose types were permitted at the media root level
  • Users can now select media files inside folders regardless of root-level permissions
  • Folders remain non-selectable

Changes:

  1. input-media.context.ts: Added isUmbracoFolder() check to the pickableFilter to exclude folders from being selectable
  2. link-picker-modal.element.ts: Removed the unnecessary #getMediaTypes() method and allowedContentTypeIds prop since folder exclusion is now handled at the filter level

Fixed: #18156

Copy link
Copy Markdown
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this one out and can confirm it works as expected. Previously I couldn't select "Image" types if I marked them as not allowed in the root, and now I can.

Please consider if you have any concerns or want second opinions on any of the front-end coding points @engijlr, and if so, we should wait for a FE-er review too. But from a functionality perspective, it looks good to me.

@engijlr
Copy link
Copy Markdown
Contributor Author

engijlr commented Feb 9, 2026

Thanks for testing it @AndyButland. I think it would be nice if we could get an opinion from a front-ender, since I removed a function that, according to my tests and investigation, was redundant and the problematic one, but it might have been there for a reason that I couldn't see.

@nielslyngsoe nielslyngsoe self-requested a review February 19, 2026 08:37
Copy link
Copy Markdown
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and is right, but my review revealed another problem.
You can pick anything, but the RTE implementation only allows for inserting images+svg.

So I created this issue:
#21824

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) February 19, 2026 09:11
@nielslyngsoe nielslyngsoe merged commit a1627b8 into main Feb 19, 2026
28 checks passed
@nielslyngsoe nielslyngsoe deleted the v17/bugfix/rte-link-picker-media-filter branch February 19, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Picking Media Items via RTE Insert Links, only allows items which are allowed at Media Root

3 participants