andrewhancox / moodle-customfield_file

File custom field
2 stars 7 forks source link

Add support for MDL-79151 #9

Open jaypha opened 10 months ago

jaypha commented 10 months ago

MDL-79151 provides the ability for custom fields to backup file annotations.

jaypha commented 10 months ago

Hello Andrew. I have been working on a fix to integrate MDL-79151 into your plugin. I have noticed that you use save the files using the config context, rather than the instance context, which is normally used.

I would like to ask if there was a specific reason for doing this?

If it is of no consequence, I would like to to change it to use the instance context. It would make backup/restore simpler and more robust. I have figured out how to do it and just need your permission.

Thanks for your time and efforts. Regards, Jason.

andrewhancox commented 10 months ago

I ended up having to write a local plugin to handle backup/restore for both this plugin and moodle-customfield_image and I’m 99% sure that there was some reason it was only possible if the files were held in the config context - but honestly, it was a long time ago now… I’m really glad this is getting handled properly in core! I have other custom field types I maintain that currently either don’t work or have weird caveats when it comes to back up and restore.

On 2 Jan 2024, at 00:09, Jason den Dulk @.***> wrote:

Hello Andrew. I have been working on a fix to integrate MDL-79151 into your plugin. I have noticed that you use save the files using the config context, rather than the instance context, which is normally used.

I would like to ask if there was a specific reason for doing this?

If it is of no consequence, I would like to to change it to use the instance context. It would make backup/restore simpler and more robust. I have figured out how to do it and just need your permission.

Thanks for your time and efforts. Regards, Jason.

— Reply to this email directly, view it on GitHub https://github.com/andrewhancox/moodle-customfield_file/issues/9#issuecomment-1873536504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEYMRIA5J6RGLADXYQ3T3YMNF23AVCNFSM6AAAAABBJMHLX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGUZTMNJQGQ. You are receiving this because you are subscribed to this thread.

jaypha commented 10 months ago

I'll leave it with you then. Thanks.

jaypha commented 7 months ago

Any word yet on support?

dmitriim commented 6 months ago

Hi @andrewhancox

it feels like backup and restore would never work for this plugin properly until context is sorted properly. Otherwise there is no way to match context when restoring to a different Moodle instance.

Context issue can be potentially fixed which will require all existing records to be updated. I have created https://github.com/andrewhancox/moodle-customfield_file/issues/10