Skip to content

Jglweb 1832 cke5 plugin fixes - #134

Merged
RandyCupic merged 3 commits into
3.0from
JGLWEB-1832-cke5-plugin-fixes
Nov 20, 2026
Merged

RandyCupic merged 3 commits into
3.0from
JGLWEB-1832-cke5-plugin-fixes

Conversation

@amalija-ramljak

Copy link
Copy Markdown
Member

Fixes from comments on netgen/remote-media-ibexa#7 that were related to core plugin functionalities

…r data

- add copyLocationsOnLoad option: loaded elements switch to a copy of their location before they can be edited
- never delete locations from the editor: undo, paste and drag and drop can bring removed elements back
- send source when updating a location, so it is kept after the first edit
- run location requests of one element one after another, update targets the location created before it
- report failed location requests through the onError option, revert the selection when creating fails
- keep stored CSS class and variation when data is saved before the selected image is loaded
- export waitForLocationRequests() and hasPendingLocationRequests() for integrations

@RandyCupic RandyCupic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested together with remote-media-ibexa#7 on Ibexa 4.6. Copy on load works: a draft no longer touches the published version, the overrides carry over to the copy and source stays after an update. The error handling and keeping cssClass and the variation before the load returns look good too. Nice work.

One thing before merge: locations have to be deleted again, no orphans. See inline.

No CI ran on this PR, please re-run it.

@RandyCupic

Copy link
Copy Markdown
Member

This goes out as 3.2.0, it adds new plugin options. Please rename the changelog section.

…delete unused locations on save

- copyLocationsOnLoad is replaced by copyLocationsOnChange: stored locations are copied on the first change of an element instead of when the editor loads, opening the editor creates nothing
- locations the editor created or copied (and, without copyLocationsOnChange, the stored locations it loaded) are deleted on submit of the form containing the editor when no editor on the page references them anymore, with keepalive requests
- deleteUnusedLocations() export for integrations which save the editor data otherwise, deleteLocation endpoint option restored
- the copy error translation is removed, a failed copy reports the update error
- changelog section renamed to 3.2.0
- getUnusedStoredLocations(form) returns, with copyLocationsOnChange, the stored locations the editors loaded which no editor on the page references anymore, for integrations to send with the saved data so the server deletes those nothing else references
- deleteUnusedLocations() takes the form to clean instead of a list of editors
@amalija-ramljak

Copy link
Copy Markdown
Member Author

@RandyCupic should be fixed now

@RandyCupic RandyCupic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Retested at aebe557 through NRMI #7. Nothing is created on open, the first change makes a copy and later changes update it, unused copies are deleted on submit, and the changelog says 3.2.0. Thanks.

I'll merge and tag 3.2.0.

@RandyCupic
RandyCupic merged commit 6a0f298 into 3.0 Nov 20, 2026
6 checks passed
@RandyCupic
RandyCupic deleted the JGLWEB-1832-cke5-plugin-fixes branch November 20, 2026 15:24
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.

2 participants