delete call on simple change

#1

Hi,

Is it normal that the function delete() override in my custom module is being call each time a settings is changed?
I thinked that delete() was call only if module is remove from page.

Thanks,

Jean-David Rivard

#2

Hey Jean-David,

I’ve already assigned another member of the team to assist you with your concern.

Ben

#3

Hey Jean-David,

That is normal as many modules use that to clear their cache when the module settings are saved or the module is deleted from the paged. Is that causing you issues somehow?

Justin

#4

Hi,

Effectively. To make a short story, I have a database entry synchronized with my module.
On update, I create my database entry and assign the ID in module settings. I bypass the frequent update with a verification on ID value. -1, seem that the object isn’t create.
On delete, I must remove database entry and delete some files. If it was just a database story, i would use the settings of the module to store the information, but I need to know when the module is really remove from page to delete file.
Maybe I can use an action on the save button. Or something on the save and publish?

Thanks,

Jean-David

#5

In fact, I think I better use the save and publish button, because before this stage, the module deletion is not official.

#6

But I still question why the delete and update function is call if I juste type a letter in a module setting textbox? In my comprehension of the function, update must be call on save button click and delete call on remove button click of the module… Maybe a future feature : a save function and a remove function…

#7

Hi Jean-David,

I agree that we need to do something here. I have filed an issue to look into adding what you have recommended. I’ll follow up when that is done.

Thanks,
Justin

closed #8