Clique Legion Error: attempt to call method RegisterForClicks

This issue is resolved in the most recent version of the addon. Do not make the changes below.

Clique is an addon for WoW which allows you to bind mouse buttons to actions or spells, such as binding left click to http://www.wowhead.com/spell=774/rejuvenation. This addon can be used in conjunction with other frame addons (e.g. Grid) and is extremely useful for healers. In the Legion beta, the addon is currently broken because it is trying to include the new nameplates as a frame, which it does not handle correctly. The fixes below will stop the error from happening in the beta.

Quick fix

If you don’t feel comfortable making the changes below, simply turn off your nameplates (press “v” in game).

Thorough fix

With the Legion beta, Clique works, but throws an error constantly, which is very annoying to ignore. The same error was reported in May 2016 on Clique’s bug report page. I was able to get a little more information using the addon’s built in debug mode combined with Swatter.

Date: 2016-07-12 12:43:46
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\Clique\Clique.lua line 930:
  attempt to call method 'RegisterForClicks' (a nil value)
Debug:
  Clique\Clique.lua:930: UpdateRegisteredClicks()
  Clique\Clique.lua:232: RegisterFrame()
  Clique\Clique.lua:182:
    Clique\Clique.lua:178
  Clique\BlizzardFrames.lua:147:
    Clique\BlizzardFrames.lua:137
  Clique\BlizzardFrames.lua:164:
    Clique\BlizzardFrames.lua:156
  [C]: CompactUnitFrame_SetUpFrame()
  ...e\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:72: ApplyFrameOptions()
  ...e\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:57: OnNamePlateAdded()
  ...e\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:24:
    ...e\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:18
Locals:
self = <table> {
}
button = NamePlate1UnitFrameBuff1 {
 0 = <userdata>
 Icon = <unnamed> {
 }
 name = "Moonfire"
 CountFrame = <unnamed> {
 }
 Cooldown = <unnamed> {
 }
 layoutIndex = 1
 Border = <unnamed> {
 }
 OnUpdate = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:415
}
direction = "AnyUp"
(*temporary) = nil
(*temporary) = NamePlate1UnitFrameBuff1 {
 0 = <userdata>
 Icon = <unnamed> {
 }
 name = "Moonfire"
 CountFrame = <unnamed> {
 }
 Cooldown = <unnamed> {
 }
 layoutIndex = 1
 Border = <unnamed> {
 }
 OnUpdate = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:415
}
(*temporary) = "AnyUp"
(*temporary) = "attempt to call method 'RegisterForClicks' (a nil value)"

AddOns:
  Swatter, v5.21f.5579 (SanctimoniousSwamprat)
  WowheadLooter, v60014
  Clique, vv60200-1.0.0
  Recount, vv6.2.4d release
  BlizRuntimeLib_enUS v7.0.3.70000 <none>
  (ck=a5)

As you can see on the error, “AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua” is referenced in the stack, which is not part of Clique. Name plates in Legion are implemented differently, and seem to be allocated when required, which means there are too many names to blacklist.

A quick fix is to disable enemy nameplates (press “v” in game), which does prevent the error. However, if you are doing quests out in the world, you likely want to display these nameplates. Adding the following code to the addon will prevent the error from displaying, and does not seem to have any side effects, but use it at your own discretion. Once an update is available from the official channels, please do not use the fix below.

In the WoW install folder, go to “Interface/AddOns/Clique” and open the “Clique.lua” file in a text editor. Locate the line which says:

function addon:UpdateRegisteredClicks(button)

Modify the lines after so it reads:

function addon:UpdateRegisteredClicks(button)
  if type(button) == "table" then
    name = button.GetName and button:GetName()
    if string.find(name, "NamePlate") ~= nil then
      return
    end
end

This will cause the addon to ignore frames starting with the name “NamePlate”.