Hmm, I'm not 100% sure, but I thought I found that the new SecureActionButtonTemplate isn't a visual template just handles the secure elements.
You would have to add in the visual elements or combine it with a visual template.
Granted the following is an XML version but the same thing should apply when creating by code.
Lua Code:
<!-- Buttons that have textures -->
<Button name = "XMP_IconTemplate" parentArray = "Buttons" virtual = "true">
<Size x="30" y="30"/>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="Icon" setAllPoints = "true"/>
</Layer>
</Layers>
<NormalTexture parentKey="NormalTexture" file="Interface\Buttons\UI-EmptySlot" setAllPoints = "true"/>
<PushedTexture parentKey ="PushedTexture" file="Interface\Buttons\CheckButtonHilight" alphaMode = "ADD" setAllPoints = "true"/>
<HighlightTexture parentKey = "HighlightTexture" file="Interface\Buttons\CheckButtonHilight" alphaMode = "ADD" setAllPoints = "true"/>
</Button>
<!-- Buttons used to cast spells -->
<Button name = "XMP_SpellButtonTemplate" inherits = "XMP_IconTemplate,SecureActionButtonTemplate" virtual = "true">
<Attributes>
<Attribute name="type" value="spell" />
<Attribute name="spell" value="0" type="number" />
</Attributes>
<Frames>
<Cooldown inherits="CooldownFrameTemplate" parentKey="Cooldown" />
</Frames>
</Button>
As you can see by this my spell button is actually a combination of an icon button template and the secureactionbuttontemplate
As you can see from this link the secureactionbuttontemplate only handles the onclick event
https://www.townlong-yak.com/framexm...eTemplates.xml
So, moving from your old button template to the new button template you have inadvertently removed the visual functionality of the button.
This is a collection of Blizzards ActionButtonTemplates.
https://www.townlong-yak.com/framexm...onTemplate.xml
As you can see these don't have any onclick functionality as Blizzard has separated them.