Remove a UDT on uninstall of a module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
chunteler
Forum Members
Forum Members
Posts: 14
Joined: Wed Oct 07, 2015 9:54 am

Remove a UDT on uninstall of a module

Post by chunteler »

Hi Everyone,

I'd like to know which code I can use to make sure a UDT is removed when a module in uninstalled. It is a UDT that gets created on installation of the same module.
Thanks in advance for your reply.

Greetings,
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: Remove a UDT on uninstall of a module

Post by rotezecke »

based on JoMorgs response (other thread) I'd try

Code: Select all

$usertagops = cmsms()->GetUserTagOperations();
$tagname = 'foo';
$usertagops->RemoveUserTag($tagname);
untested.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Remove a UDT on uninstall of a module

Post by calguy1000 »

Just a silly question.... why is your module creating/removing UDT's ?

PHP code is what module actions are for.

You may want to check out the new (not yet announced) module writing tutorial that is available in the 'Advanced' section of the docs site.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
chunteler
Forum Members
Forum Members
Posts: 14
Joined: Wed Oct 07, 2015 9:54 am

Re: Remove a UDT on uninstall of a module

Post by chunteler »

Thanks Rotezecke and Calguy1000.
I've now indeed realized I can much better use actions to do this.
Thanks anyway.
Locked

Return to “Developers Discussion”