Bagnon

Bagnon

122M Downloads

Bank Sort not working

PJai opened this issue Β· 11 comments

commented

Which software were you running?

  • Addon version name: Bagnon 11.0.2
  • Client used: Classic 1.15.3.55917

Have you read the changelog?
Yes

Please describe the bug.
LUA Error when pressing on Bank Sort Icon. Sort not working.

Error Log
`1x BagBrother/frames/containers/bank.lua:25: attempt to call field 'SortBankBags' (a boolean value)
[string "@BagBrother/frames/containers/bank.lua"]:25: in function <BagBrother/frames/containers/bank.lua:23>
[string "=(tail call)"]: ?

Locals:
self = BagnonBank1 {
0 =
SearchFrame = EditBox {
}
Currency = Frame {
}
bg = Frame {
}
quality = 0
SearchToggle = CheckButton {
}
SortButton = CheckButton {
}
id = "bank"
ItemGroup = Frame {
}
Money = BagnonMoneyFrame2 {
}
profile =

{
}
CloseButton = Button {
}
Title = Button {
}
Broker = Button {
}
OptionsToggle = Button {
}
BagToggle = CheckButton {
}
MenuButtons =
{
}
OwnerSelector = Button {
}
}
(*temporary) = false
(*temporary) = "attempt to call field 'SortBankBags' (a boolean value)"
Addon =
{
PickupItem = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:280
IsRetail = false
GetOwnerID = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:300
InventoryBags =
{
}
Currency =
{
}
InBank = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:397
Skins =
{
}
ItemGroup =
{
}
ContainerItemGroup =
{
}
SetDefaults = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:74
RestoreItemData = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:334
Frame =
{
}
OptionsToggle =
{
}
Bag =
{
}
Bagnon_BoE =
{
}
IsBank = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:424
RegisterMessage = defined @AdvancedInterfaceOptions/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:80
UnregisterMessage = defined @AdvancedInterfaceOptions/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:143
IsBagCached = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:321
CurrencyTooltipCounts =
{
}
Base =
{
}
UnregisterSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:95
GetOwnerAddress = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:305
RegisterEvent = defined @AdvancedInterfaceOptions/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:80
sets =
{
}
OnEnable = defined @BagBrother/core/core.lua:37
Name = "Bagnon"
IterateOwners = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:135
InGuild = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:405
Parented =
{
}
guild =
{
}
Cacher =
{
}
NewModule = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:68
NumBags = 4
ReagentButton =
{
}
player =
{
}
RestorePetLinkData = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:388
Settings =
{
}
IsClassic = true
BankBags =
{
}
ItemSlot =
{
}
SearchToggle =
{
}
OwnerSelector =
{
}
SearchFrame =
{
}
Commands =
{
}
Title =
{
}
SortButton =
{
}
Slash = "bgn"
Item =
{
}
Frames =
{
}
ContainerItem =
{
}
BagGroup =
{
}
BagToggle =
{
}
Events =
{
}
IsOwnerCached = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:317
TooltipCounts =
{
}
LDB =
{
}
AutoDisplay =
{
}
Tag = "BAGNON_"
Inventory =
{
}
IsBackpackBag = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:416
GetOwnerInfo = defined @BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:95
BrokerCarrousel =
{
}
CurrencyTracker =
{
}
SendSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:99
UnregisterAllEvents = defined @AdvancedInterfaceOptions/libs/CallbackHandler`

commented

Confirm, bag sort does not work, Classic 1.15.3.... Although I do not get an error code, it just simply does not do any function when I click on cleanup.

commented

I can also Confirm that for Cata Classic.
Got the same Error as in the first Message here.

commented

Can confirm. Cant use Sort-Button in Bank.

  • Addon version name: Bagnon 11.0.2
  • Client used: Classic 1.15.3.55917

LUA-Error:
Message: ...terface/AddOns/BagBrother/frames/containers/bank.lua:25: attempt to call field 'SortBankBags' (a boolean value)
Time: Thu Aug 15 10:43:13 2024
Count: 1
Stack: ...terface/AddOns/BagBrother/frames/containers/bank.lua:25: attempt to call field 'SortBankBags' (a boolean value)
[string "@Interface/AddOns/BagBrother/frames/containers/bank.lua"]:25: in function <...terface/AddOns/BagBrother/frames/containers/bank.lua:23>
[string "=(tail call)"]: ?

Locals: self = BagnonBank1 {
0 =
SearchFrame = EditBox {
}
Currency = Frame {
}
bg = Frame {
}
quality = 0
SearchToggle = CheckButton {
}
ItemGroup = Frame {
}
SortButton = CheckButton {
}
id = "bank"
Money = BagnonMoneyFrame2 {
}
OptionsToggle = Button {
}
profile =

{
}
CloseButton = Button {
}
Title = Button {
}
Broker = Button {
}
BagToggle = CheckButton {
}
OwnerSelector = Button {
}
MenuButtons =
{
}
manualShown = true
}
(*temporary) = false
(*temporary) = "attempt to call field 'SortBankBags' (a boolean value)"
Addon =
{
PickupItem = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:280
IsRetail = false
GetOwnerID = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:300
InventoryBags =
{
}
Currency =
{
}
InBank = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:397
Skins =
{
}
ItemGroup =
{
}
ContainerItemGroup =
{
}
SetDefaults = defined @Interface/AddOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:74
RestoreItemData = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:334
Frame =
{
}
OptionsToggle =
{
}
Bag =
{
}
IsBank = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:424
RegisterMessage = defined @Interface/AddOns/AtlasLootClassic/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:80
UnregisterMessage = defined @Interface/AddOns/AtlasLootClassic/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:143
IsBagCached = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:321
CurrencyTooltipCounts =
{
}
Base =
{
}
UnregisterSignal = defined @Interface/AddOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:95
GetOwnerAddress = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:305
RegisterEvent = defined @Interface/AddOns/AtlasLootClassic/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:80
sets =
{
}
OnEnable = defined @Interface/AddOns/BagBrother/core/core.lua:37
Name = "Bagnon"
IterateOwners = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:135
InGuild = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:405
Parented =
{
}
guild =
{
}
Cacher =
{
}
NewModule = defined @Interface/AddOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:68
NumBags = 4
ReagentButton =
{
}
player =
{
}
RestorePetLinkData = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:388
Settings =
{
}
IsClassic = true
BankBags =
{
}
ItemSlot =
{
}
SearchToggle =
{
}
OwnerSelector =
{
}
SearchFrame =
{
}
Commands =
{
}
Title =
{
}
SortButton =
{
}
Slash = "bgn"
Item =
{
}
Frames =
{
}
ContainerItem =
{
}
BagGroup =
{
}
BagToggle =
{
}
Events =
{
}
IsOwnerCached = defined @Interface/AddOns/BagBrother/libs/LibItemCache-2.0/LibItemCache-2.0.lua:317
TooltipCounts =
{
}
LDB =
{
}
AutoDisplay =
{
}
Tag =

commented

Hi I'm also getting the same error. I plugged the error into ChatGPT to try and understand better and this was the reply:

The Lua error you're encountering is due to an attempt to call SortBankBags, which is expected to be a function but is instead being treated as a boolean value (true or false). This indicates that somewhere in the code, SortBankBags is being overridden or incorrectly assigned.

Error Breakdown:
Error Message: BagBrother/frames/containers/bank.lua:25: attempt to call field 'SortBankBags' (a boolean value)
Location: The error occurs on line 25 of bank.lua in the BagBrother addon.
Cause: The variable SortBankBags is being treated as a boolean instead of a function.
Common Causes:
Overriding the Function: If SortBankBags is mistakenly reassigned elsewhere in the code as a boolean, it would cause this error when the code tries to call it as a function.
Conflict with Other Addons: Another addon or part of the code might be redefining SortBankBags, leading to a conflict.
Incorrect Initialization: If SortBankBags is not properly initialized as a function, it might default to a boolean value.
Potential Fixes:
Check for Reassignment:

Search through the codebase (including other addons) to see if SortBankBags is being reassigned or incorrectly defined as a boolean.
It should be defined as a function, typically part of the WoW API or the addon’s own functions.
Isolate the Problem:

Disable other addons and see if the problem persists. If the error goes away, there may be a conflict with another addon that is redefining SortBankBags.
Debugging:

Insert debugging print statements before the line where the error occurs to see what value SortBankBags holds at runtime:
lua
Copy code
print("SortBankBags:", type(SortBankBags))
If it prints boolean, you’ll know it’s being overridden somewhere before this call.
Revert to Defaults:

If you've recently updated or modified the BagBrother addon, try reverting to a previous version or restoring default settings.

commented

experiencing the same issue. I reverted to 10.2.31 and it worked again.

commented

same problem with WoW Classic Era 1.15.3
A fix would be awesome!
Thanks in advance!

commented

I uninstalled and installed the previous version using Curseforge which fixes the issue. Playing on Wow Classic Era 1.15.3

commented

Had the same issue myself but was able to fix it quite easily.
The error you're encountering indicates that SortBankBags is being called as if it were a function, but it's actually a boolean value. So you only need to change the type of SortBankBags from bool to function.

Short instruction how to:

Open bank.lua, default folder is: *\World of Warcraft_classic_\Interface\AddOns\BagBrother\frames\containers

Change this:

function Bank:SortItems()
	if Addon.sets.serverSort and C.SortBankBags then
		C.Container.SortBankBags()

		if REAGENTBANK_CONTAINER then -- callback cascade of doom!
			EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
				C.Timer.After(0, function()
					C.Container.SortReagentBankBags()
					EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
						C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
					end)
				end)
			end)
		end
	else
		self:Super(Bank):SortItems()
	end
end

To this:

function Bank:SortItems()
    if Addon.sets.serverSort and type(C.SortBankBags) == 'function'then
        C.Container.SortBankBags()

        if REAGENTBANK_CONTAINER then
            EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                C.Timer.After(0, function()
                    C.Container.SortReagentBankBags()
                    EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                        C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
                    end)
                end)
            end)
        end
    else
        self:Super(Bank):SortItems()
    end
end
commented

Had the same issue myself but was able to fix it quite easily. The error you're encountering indicates that SortBankBags is being called as if it were a function, but it's actually a boolean value. So you only need to change the type of SortBankBags from bool to function.

Short instruction how to:

Open bank.lua, default folder is: *\World of Warcraft_classic_\Interface\AddOns\BagBrother\frames\containers

Change this:

function Bank:SortItems()
	if Addon.sets.serverSort and C.SortBankBags then
		C.Container.SortBankBags()

		if REAGENTBANK_CONTAINER then -- callback cascade of doom!
			EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
				C.Timer.After(0, function()
					C.Container.SortReagentBankBags()
					EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
						C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
					end)
				end)
			end)
		end
	else
		self:Super(Bank):SortItems()
	end
end

To this:

function Bank:SortItems()
    if Addon.sets.serverSort and type(C.SortBankBags) == 'function'then
        C.Container.SortBankBags()

        if REAGENTBANK_CONTAINER then
            EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                C.Timer.After(0, function()
                    C.Container.SortReagentBankBags()
                    EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                        C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
                    end)
                end)
            end)
        end
    else
        self:Super(Bank):SortItems()
    end
end

I was having the same issue as everyone else, I tested ziegldom's fix and it works now. Thanks ziegldom!

commented

Had the same issue myself but was able to fix it quite easily. The error you're encountering indicates that SortBankBags is being called as if it were a function, but it's actually a boolean value. So you only need to change the type of SortBankBags from bool to function.

Short instruction how to:

Open bank.lua, default folder is: *\World of Warcraft_classic_\Interface\AddOns\BagBrother\frames\containers

Change this:

function Bank:SortItems()
	if Addon.sets.serverSort and C.SortBankBags then
		C.Container.SortBankBags()

		if REAGENTBANK_CONTAINER then -- callback cascade of doom!
			EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
				C.Timer.After(0, function()
					C.Container.SortReagentBankBags()
					EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
						C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
					end)
				end)
			end)
		end
	else
		self:Super(Bank):SortItems()
	end
end

To this:

function Bank:SortItems()
    if Addon.sets.serverSort and type(C.SortBankBags) == 'function'then
        C.Container.SortBankBags()

        if REAGENTBANK_CONTAINER then
            EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                C.Timer.After(0, function()
                    C.Container.SortReagentBankBags()
                    EventUtil.RegisterOnceFrameEventAndCallback('ITEM_UNLOCKED', function()
                        C.Timer.After(0, function() self:SendSignal('SORTING_STATUS') end)
                    end)
                end)
            end)
        end
    else
        self:Super(Bank):SortItems()
    end
end

This worked for me 8/16/24. Thanks ziegledom!

commented

Thanks for fixing this @ziegldom