Skip to content

Add multi-upload and ordered gallery support - #124

Open
RandyCupic wants to merge 9 commits into
4.0from
multiupload
Open

RandyCupic wants to merge 9 commits into
4.0from
multiupload

Conversation

@RandyCupic

Copy link
Copy Markdown
Member

Replaces #122, rebased onto 4.0 (the branch was renamed from 3.0-multiupload to multiupload, which closed #122).

Adds a collection mode to the remote media form type and picker. Editors can select or upload several resources, reorder them, and edit alt text, caption and crops per item. Single-media fields behave as before.

  • RemoteMediaType is split into a single type and a new RemoteMediaCollectionType. The submitted collection replaces the stored one, so clearing a gallery sticks.
  • Malformed payloads fail the form instead of emptying the collection. Location ids that don't belong to the edited value are ignored.
  • Picker:
    • multi-select and drag to reorder;
    • optional upload limit per field;
    • items already in the gallery are skipped when browsing or uploading;
    • folder placeholders never create folders in Cloudinary.
  • Replacing a single image keeps its watermark.
  • The bundled CKEditor plugin passes the new picker options, so embeds keep working with the shared picker.
  • Translation keys for the multi-select UI (en, hr, no) and a new Norwegian Bokmål (nb) file.
  • Dist assets in bundle/Resources/public rebuilt (Node 12).

Behaviour changes:

  • If a resource no longer exists in Cloudinary when its metadata is saved, the local resource and its locations are kept and a warning with the remote id is logged. Before, the resource was deleted locally, which also removed it from every other field using it.
  • Tags are compared and stored sorted, so a different tag order no longer triggers a Cloudinary update on every save.

CI: the test matrix now uses Symfony ~6.4.0 instead of ~6.2.0. Composer refuses every 6.2 release because of security advisories, so that job could not install dependencies; it fails the same way on 3.0 since February. 6.4 is the maintained LTS.

Rebase notes:

  • The merge of origin/3.0 was dropped by the rebase; its test expectation change in UploadTest is restored in a separate commit.
  • The folder-aware existing resource error from Feature/asset folder public id prefix #123 is ported to MultiUploadInline.vue (UploadModal.vue is removed here), with the nb translation and the rebuilt app bundle.
  • The CI change to Symfony ~6.4.0 is already in 4.0, so that commit was skipped.

mivancic and others added 9 commits October 20, 2026 09:57
Implement upload-limited multi-resource handling with multi-select and
reorderable gallery cards, split RemoteMediaType into single and
collection form types, convert the multi-gallery components to
props-down/events-up data flow, and improve the multi-upload UX, i18n
and wire format. Add a Norwegian Bokmål (nb) translation file.

Fix the CKEditor "Manage Media" modal so the gallery renders in
collection mode (default the embed to single-select and guard the
missing multi-select translation key that was blanking the gallery).
Includes rebuilt NGRM frontend assets (remotemedia.js +
remotemedia.css).
Clearing a gallery now sticks, folder placeholders no longer create Cloudinary folders and existing CKEditor embeds load their media. Malformed payloads fail the form instead of emptying the collection.
Browsing or uploading into a gallery now skips resources that are already in it and stops at the upload limit, and replacing a single image keeps its watermark.
…mote

The metadata is still saved locally, and the warning names the remote id so missing assets can be found.
Import order and missing function imports, no short ternary in the collection transformer, and intersection-typed provider mocks in the form type tests.
The multi-upload rewrite dropped the always-present remoteId input, so removing the media from a single field sent nothing and forms that keep the previous value on a missing field could not clear it. Dist rebuilt with Node 12.
'Alternate text': 'Alternate text',
'Class': 'CSS class',
'Create new folder?': 'Create new folder?',
'Create new folder?': 'ngrm.edit.vue.upload.button.create'|trans,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mivancic Why only these two were moved to translations?

Comment thread docs/CHANGELOG.md

### Changed

* `RemoteMediaType` keeps its strict single-resource contract (one `RemoteResourceLocation` or `null`); the `upload_limit` option introduced during development was moved to `RemoteMediaCollectionType`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mivancic You decided to keep both single and collection? Hmm, is this to support v3.0?

@RandyCupic

Copy link
Copy Markdown
Member Author

@mivancic When you select multiple images in gallery, and then you go to select more, it doesn't show these that are already added as selected or grayed out. In fact, you can select them again. It won't add them again but it messes up with limitation. For example, I've put limit to 5 and I've selected 3 images. Then I went to select more, and again I've selected 2 of the same images so I was not able to select more (as I already had 5 images in total) but when you actually go to add them, there are only 3.

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