Jump to content

How to delete custom saved language strings in plugin?


TAMAN
 Share

Recommended Posts

I have created a reusable widget in my plugin and im using translatable form fields to save a title and content. and i do it just like how ips does it for example in Most Contributions widget ...\core\widgets\mostContributions it is a reusable widget with a translatable form 

 

i have added the delete method in my widget like this

	public function delete()
	{
		\IPS\Lang::deleteCustom( 'core', $this->configuration['tacw_title_lang'] );
		\IPS\Lang::deleteCustom( 'core', $this->configuration['tacw_content_lang'] );
	}

$this->configuration['tacw_title_lang'] returns the unique language key to delete 

but it does not delete anything and the key is still in the core_sys_lang_words in the database table 

@Daniel F  the default ips Most Contributions widget seem to have the same issue. the language string used for the title is not deleted in the database when the widget is removed! can you please help

 

 

Edited by TAMAN
Link to comment
Share on other sites

8 hours ago, TAMAN said:

the default ips Most Contributions widget seem to have the same issue. the language string used for the title is not deleted in the database when the widget is removed! can you please help

I can't reproduce this!

1. we have the cleanup code in the Widgets delete method
2. I can confirm that it's called 

 

Please don't forget that it won't be removed immediately, there's a cleanup task which calls this frequently.

As far as I remember your widget didn't have a delete method?

Link to comment
Share on other sites

3 hours ago, Daniel F said:

Please don't forget that it won't be removed immediately, there's a cleanup task which calls this frequently.

That's it then 😅 no problems I will re-upload the plugins later.  Thank you.

 

And i wish to disable this kind of tasks when Dev mod is enabled! it creates a headache for newbies like me lol

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...