digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
56 stars 34 forks source link

Copy used media library items when cloning region #1414

Open timobrembeck opened 2 years ago

timobrembeck commented 2 years ago

Describe the Bug

When regions are cloned, the media library is not cloned as well

Steps to Reproduce

  1. Create region
  2. Select other region to clone contents from
  3. Go into new region

Expected Behavior

The media library should be cloned as well

Actual Behavior

The media library is not cloned

Additional Information

svenseeberg commented 2 years ago

This behavior is currently intended. The links to images are not replaced in pages, therefore all pages are linking to images in the source region. Therefore there is no technical requirement for copying the media library.

We already have another feature planned to replace links in all pages #1382. This could make cloning media items more interesting. IMHO we can make this a post release feature request.

svenseeberg commented 2 years ago

To sum up discussions in chat: it would be nice to copy files that are being used (included in pages or events) and update image source attributes accordingly (#1382 & #1383).

dkehne commented 2 years ago

mhh i want to add more prio to that. I have cloned siegen-wittgenstein now and no icons were replicated. To ensure that they are able to choose from all yellow icons i will add them all to their media library manually.

svenseeberg commented 2 years ago

mhh i want to add more prio to that. I have cloned siegen-wittgenstein now and no icons were replicated. To ensure that they are able to choose from all yellow icons i will add them all to their media library manually.

This problem has been solved by using the central media library.

timobrembeck commented 1 year ago

To sum up discussions in chat: it would be nice to copy files that are being used (included in pages or events) and update image source attributes accordingly (#1382 & #1383).

2048 contains a block that can easily be inverted to get all used media files:

https://github.com/digitalfabrik/integreat-cms/blob/d5237e2ee91fa84bd574aaf02798d19ac3b0d6be/integreat_cms/cms/models/media/media_file.py#L127-L146

JoeyStk commented 4 months ago

@svenseeberg Is there still an open question or could the question label be removed? :slightly_smiling_face: