AdiBags

AdiBags

8M Downloads

Bug with adi-bag

Maleyana opened this issue ยท 2 comments

commented

Date: 2020-04-06 08:40:20
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\AdiBags\modules\Junk.lua line 246:
attempt to call method 'HookScript' (a nil value)
Debug:
[string "@AdiBags\modules\Junk.lua"]:246: in main chunk
Locals:
addonName = "AdiBags"
addon =

{
AcquireItemButton = defined @interface\AddOns\AdiBags\widgets\ItemButton.lua:155
modules =
{
}
UpdateFilters = defined @interface\AddOns\AdiBags\core\Filters.lua:83
SecureHook = defined @interface\AddOns\AdiBags\libs\AceHook-3.0\AceHook-3.0.lua:336
GetInteractingWindow = defined @interface\AddOns\AdiBags\core\Core.lua:451
ConfigChanged = defined @interface\AddOns\AdiBags\core\Core.lua:371
GetSlotId = defined @interface\AddOns\AdiBags\core\Utility.lua:57
Filter = defined @interface\AddOns\AdiBags\core\Filters.lua:144
IsEnabled = defined @interface\AddOns\AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:451
Reconfigure = defined @interface\AddOns\AdiBags\core\Core.lua:183
SetupTooltip = defined @interface\AddOns\AdiBags\core\Utility.lua:114
RegisterMessage = defined @interface\AddOns\Scrap\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:90
UnregisterMessage = defined @interface\AddOns\Scrap\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:153
hooks =
{
}
GetDistinctItemID = defined @interface\AddOns\AdiBags\core\Utility.lua:188
CreateFont = defined @interface\AddOns\AdiBags\core\Fonts.lua:122
filterProto =
{
}
OpenOptions = defined @interface\AddOns\AdiBags\core\Core.lua:289
SetEnabledState = defined @interface\AddOns\AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:424
Hook = defined @interface\AddOns\AdiBags\libs\AceHook-3.0\AceHook-3.0.lua:274
IterateBags = defined @interface\AddOns\AdiBags\core\Bags.lua:183
OnEnable = defined @interface\AddOns\AdiBags\core\Core.lua:115
HookBagFrameCreation = defined @interface\AddOns\AdiBags\core\Bags.lua:305
NewBag = defined @interface\AddOns\AdiBags\core\Bags.lua:150
GetClass = defined @interface\AddOns\AdiBags\core\OO.lua:129
RegisterFilter = defined @interface\AddOns\AdiBags\core\Filters.lua:120
BACKDROP =
{
}
OnInitialize = defined =[C]:-1
NewModule = defined @interface\AddOns\AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:235
InitializeFilters = defined @interface\AddOns\AdiBags\core\Filters.lua:64
IterateFilters = defined @interface\AddOns\AdiBags\core\Filters.lua:116
ReagentBankUpdated = defined @interface\AddOns\AdiBags\core\Core.lua:362
CreateBagSlotPanel = defined @interface\AddOns\AdiBags\widgets\BagSlots.lua:437
TOP_PADDING = 32
hookedBags =
{
}
OpenBag = defined @interface\AddOns\AdiBags\core\Hooks.lua:137
ToggleAllBags = defined @interface\AddOns\AdiBags\core\Hooks.lua:86
OnProfileChanged = defined @interface\AddOns\AdiBags\core\Core.lua:191
GetName = defined @interface\AddOns\AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:279
name = "AdiBags"
OpenBackpack = defined @interface\AddOns\AdiBags\core\Hooks.lua:168
LayoutBags = defined @interface\AddOns\AdiBags\core\Layout.lua:101
Disable = defined @interface\AddOns\AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:314
SetGlobalLock = defined @interface\AddOns\AdiBags\core\Core.lua:419
Unhook = defined @interface\AddOns\AdiBags\libs\AceHook-3.0\AceHook-3.0.lua:418
Print = defined @interface\AddOns\AdiBags\libs\AceConsole-3.0\AceConsole-3.0.lua:54
OpenAllBags = defined @interface\AddOns\AdiBags\core\Hooks.lua:109
L =
{
}
safecall = defined @interface\AddOns\AdiBags\core\Utility.lua:81
Debug = defined @interface\AddOns\AdiBags\core\Core.lua:61
CreateAnchorWidget = defined @interface\AddOns\AdiBags\widgets\AnchorWidget.lua:37
ITEM_SIZE = 37
DEFAULT_SETTINGS =
{
}
CreateBagAnchorWidget = defined @interface\AddOns\AdiBags\widgets\AnchorWidget.lua:218
FAMILY_ICONS =
{
}
UnregisterEvent = defined @interface
AddOns:
Swatter, v7.3.1 (<%codename%>)
AdiBags, vv1.9.18
Scrap, v8.3.2
BlizRuntimeLib_frFR v8.3.0.80300
(ck=6f)

commented

See #416 & #422; fixed via ae53167.

commented

The fix is currently pending a PR merge #422

This is what I did (keeping the old code around):

FILE: ..\AddOns\AdiBags\modules\Junk.lua line 246

        -- Scrap:HookScript('OnReceiveDrag', function()
        --      if prefs.sources.Scrap then
        --              wipe(cache)
        --              addon:SendMessage("AdiBags_FiltersChanged")
        --      end
        -- end)

        -- BEGIN SCRAP FIX -- 
        local function updateScrap()
                if prefs.sources.Scrap then
                        wipe(cache)
                        addon:SendMessage("AdiBags_FiltersChanged")
                end
        end

        if Scrap.HookScript then
                Scrap:HookScript('OnReceiveDrag', updateScrap)
        end

        if Scrap.Merchant and Scrap.Merchant.HookScript then
                Scrap.Merchant:HookScript('OnReceiveDrag', updateScrap)
        end

        if Scrap.ToggleJunk then
                _G.hooksecurefunc(Scrap, "ToggleJunk", updateScrap)
        end
        -- END SCRAP FIX --