[Classic] Wrong GetSpellId since LAB update #2434


  • New
  • Defect
Open
  • Ennvina created this issue Jul 27, 2026

    Since the latest update of LibActionButton to 153, GetSpellId no longer works with macros.

     

    Apologies, this is going to be a bit technical. But by the end of this issue, you will have everything needed to understand what happens. Plus, you'll have a fix which is more elegant and faster than current code.

    Example

    Easy steps to reproduce the issue

    1. create a macro that casts a spell, for example /cast Frostbolt
    2. put this macro in the first button of the first action bar (BT4Button1)
    3. run this script /dump BT4Button1:GetSpellId()

    With Bartender 4.17.7 it displays the spell ID of Frostbolt.

    With Bartender 4.17.8 it displays "empty result", which means nil in Lua.

    When did it break

    LibActionButton was recently updated from 151 to 153. The code of Action.GetSpellId has changed from

     

    Action.GetSpellId = function(self)
      local actionType, id, subType = GetActionInfo(self._state_action)
      if actionType == "spell" then
        return id
      elseif actionType == "macro" then
        if subType == "spell" then
          return id
        else
          return (GetMacroSpell(id))
        end
      end
    end

     

    to

     

    Action.GetSpellId = function(self)

      local actionType, id, subType = GetActionInfo(self._state_action)
      if actionType == "spell" then
        return id
      elseif actionType == "macro" then
        if subType == "spell" then
          return id
        elseif subType == "item" then
          return nil -- item macros seems to return bogus values we can't support
        else
          return nil -- what else is there? spell id is only used for highlights and cast bars   end

        end

      end
    end

     

    In other words, LAB now inspects subType, the 3rd value of GetActionInfo.

     

    The problem is, subType is unreliable on WoW Classic.

     

    For example if you bind a spell macro to BT4Button1, simply run this script:

    /dump GetActionInfo(BT4Button1._state_action)

     

    This returns a subType in Retail. This does returns a nil subType on Classic (tested with Era, TBC Anniversary, and MoP).

    So, what can we do?

    First of all, it's most likely a bug from the game client. So in a way, Bartender did not really break anything.

     

    However, there is no official source that states that subType is supposed to be "spell". It looks like an ad hoc deduction, not a true specification.

     

    I see 2 ways to fix it:

    1. Revert to the old code, unconditionally invoking GetMacroSpell no matter what subType says
    2. Use the new API C_ActionBar.GetSpell which works with both macros and non-macros

    I recommend the second option, because (i) I assume GetMacroSpell was removed for a reason, and (ii) C_ActionBar is the new official tool for dealing with action bars.

     

    Plus, GetSpellId would be much simpler

     

    Action.GetSpellId = function(self)

      return C_ActionBar.GetSpell(self._state_action)
    end

     

    The one caveat is that it requires that the game client supports C_ActionBar.GetSpell. Fortunately, all Live versions of the game client seem to support it as of today (July 27th, 2026).

     

  • Ennvina added the tags Defect New Jul 27, 2026

To post a comment, please login or register a new account.