Sorry, we don't support your browser.  Install a modern browser

Renaming file should update its references#189

Currently, the renaming feature for files (images, etc) feels broken. When renaming an image, the references to that image are not updated, resulting in broken content. What’s the use of being able to rename a file if its references aren’t updated? This feels more like a bug to be fixed than a feature request.

2 years ago
?

I can confirm that. Same behaviour on Page Renaming and User Renaming.

2 years ago
5

I think this should be addressed ASAP, its quite confusing for panel users understand that if they change a file also need to update other parts of the panel. And if they dont, sometimes this can break the whole site.

2 years ago
1

I am afraid this is quite impossible feature with flat file architecture. There is no relational database so there are no references. It happens around kirby and you have to keep eye on that. It’s just tradeoff given simplicity of the system.

2 years ago

Kirby using the file-system as a DB does not mean this is impossible.

One approach that comes to mind: An array of reference IDs could be stored in each file’s metadata file (IDs to each document that uses the file). Then, when renaming a file, it’d be a simple matter of parsing the content of the dependency files and updating the filename(s) therein.

2 years ago

It is entirely possible to recreate database on filesystem using PHP… but at some point you start to recreate what traditional databases offer.

2 years ago

Like with page references, it would probably make more sense to store an ID (attached to an image via the file metadata) for the image rather than keep changing the references. This is already possible via the AutoID-Plugin: https://github.com/bnomei/kirby3-autoid/, which will hopefully make it to the core one day.

https://kirby.nolt.io/16

2 years ago
4
?

Have gone the way with autoid but i get the weird “Invalid argument supplied for foreach()”. And since it is not only applicable to Files but Pages and Users too a quick Fix should be done… Is there any updates on this. Anyone else has these errors?

2 years ago
?

It does feel like a ‘bug’ - hopefully it will get fixed soon!

10 months ago
?

We need the equivalent of a database’s “cascade on update”.

9 months ago