Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon.lua:15: attempt to call global 'GetAddOnMetadata' (a nil value) #7

Open
Ookami313 opened this issue Aug 15, 2024 · 2 comments
Open

Comments

@Ookami313
Copy link

Unsure if the addon is still being supported or not, but the update to 11.0.2 is causing it to produce errors when logging into the game. Thanks.

5x HandyNotes_WellRead/Addon.lua:15: attempt to call global 'GetAddOnMetadata' (a nil value)
[string "@HandyNotes_WellRead/Addon.lua"]:15: in main chunk

Locals:
ADDON_NAME = "HandyNotes_WellRead"
HandyNotes =

{
modules =
{
}
plugins =
{
}
defaultModuleLibraries =
{
}
name = "HandyNotes"
orderedModules =
{
}
baseName = "HandyNotes"
db =
{
}
WorldMapDataProvider =
{
}
enabledState = true
defaultModuleState = true
}
ACHIEVEMENT_ID = 1244
ICON = "Interface\AddOns\HandyNotes_WellRead\Book"
(*temporary) = nil
(*temporary) = "HandyNotes_WellRead"
(*temporary) = "Title"
(*temporary) = "attempt to call global 'GetAddOnMetadata' (a nil value)"

@Dhragas
Copy link

Dhragas commented Aug 16, 2024

To fix it, just change:
GetAddOnMetadata → C_AddOns.GetAddOnMetadata

@daxigua249121589
Copy link

Just replace
local ADDON_NAME = ...
local HandyNotes = LibStub("AceAddon-3.0"):GetAddon("HandyNotes")

local ACHIEVEMENT_ID = 1244
local ICON = "Interface\AddOns\HandyNotes_WellRead\Book"
local ADDON_TITLE = GetAddOnMetadata(ADDON_NAME, "Title")
local ACHIEVEMENT_NAME = select(2, GetAchievementInfo(ACHIEVEMENT_ID))

with the new one

local ADDON_NAME = ...
local HandyNotes = LibStub("AceAddon-3.0"):GetAddon("HandyNotes")

local ACHIEVEMENT_ID = 1244
local ICON = "Interface\AddOns\HandyNotes_WellRead\Book"

-- Check if GetAddOnMetadata exists
local ADDON_TITLE
if GetAddOnMetadata then
ADDON_TITLE = GetAddOnMetadata(ADDON_NAME, "Title")
else
ADDON_TITLE = "HandyNotes Well Read" -- Fallback title
end

local ACHIEVEMENT_NAME = select(2, GetAchievementInfo(ACHIEVEMENT_ID))

I use chatgpt did it.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants