Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook before renaming files and folders #108

Closed
Elvinca opened this issue Nov 24, 2022 · 3 comments
Closed

Hook before renaming files and folders #108

Elvinca opened this issue Nov 24, 2022 · 3 comments

Comments

@Elvinca
Copy link

Elvinca commented Nov 24, 2022

Hello,

I am facing a problem. When user renames a file / folder, I need all paths associated with this file / folder to get changed. Is there any hook or something that could help me resolve this?

Many thanks in advance. :)

@Rezrazi
Copy link
Collaborator

Rezrazi commented Nov 24, 2022

Hi
Can you clarify a bit more what you mean by "all paths associated with this file / folder to get changed" ?

@Elvinca
Copy link
Author

Elvinca commented Nov 25, 2022

For example, I have resource with image saved as "{'disk':'public','path':'foo/bar/image.jpg'}" and I will rename the file to "image_renamed.jpg" in file manager. After renaming I need the path in resource's image column to get changed to
"{'disk':'public','path':'foo/bar/image_renamed.jpg'}". This would apply for all resources which have this image set in their fields...

Let me know if you need any more clarification.

Thanks.

@mikaelpopowicz
Copy link
Collaborator

Hi @Elvinca

You may listen to the FileRenamed event. You will find the event documentation here.

Regards

@Rezrazi Rezrazi closed this as completed Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants