Skip to content

fix: use correct page id for ProcessPageEditImageSelect modal when editing already inserted image - #330

Open
brttd wants to merge 1 commit into
processwire:devfrom
brttd:fix/tinymce-image-edit-in-repeater
Open

fix: use correct page id for ProcessPageEditImageSelect modal when editing already inserted image#330
brttd wants to merge 1 commit into
processwire:devfrom
brttd:fix/tinymce-image-edit-in-repeater

Conversation

@brttd

@brttd brttd commented May 18, 2026

Copy link
Copy Markdown

The pwimage plugin for InputfieldTinyMCE (when opening the editing modal):

  1. Checks if an image node is selected, and if so extracts the page id (of which the selected image resides) from the image src attribute.
  2. Checks if the inputfield is inside a repeater (and if that repeater includes an image field), and if so sets the page id to the repeater item's page id.

This is the wrong way around. If editing an already inserted image, the editing modal (for ProcessPageEditImageSelect) has the page id set to the repeater, instead of which page actually contains the selected image. If an image from another page has been selected and inserted, the editing modal won't work and displays an error saying it can't find the image.
This PR fixes the issue by simply swapping those two checks, so when editing an existing image it will override the repeater page id. When inserting a new image, the repeater page id will still be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant