Thaoky / DataStore_Reputations

WoW DataStore Addon - Reputations Module
2 stars 1 forks source link

Bug since upgrade 11.0 #1

Open deksan opened 3 months ago

deksan commented 3 months ago

Hi,

LUA Error : Date: 2024-07-24 10:51:55 ID: 1 Error occured in: Global Count: 1 Message: ...dOns/DataStore_Reputations/DataStore_Reputations.lua line 36: attempt to call upvalue 'GetFactionInfoByID' (a nil value) Debug: [string "@Interface/AddOns/DataStore_Reputations/DataStore_Reputations.lua"]:36: AddFaction() [string "@Interface/AddOns/DataStore_Reputations/DataStore_Reputations.lua"]:183: in main chunk Locals: id = 1515 text = nil (temporary) = nil (temporary) = 1515 (*temporary) = "attempt to call upvalue 'GetFactionInfoByID' (a nil value)" GetFactionInfoByID = nil factions =

{ 1269 = "Golden Lotus" 1031 = "Sha'tari Skyguard" 1174 = "Wildhammer Clan" 369 = "Gadgetzan" 1492 = "Emperor Shaohao" 1012 = "Ashtongue Deathsworn" 1270 = "Shado-Pan" 909 = "Darkmoon Faire" 270 = "Zandalar Tribe" 933 = "The Consortium" 941 = "The Mag'har" 576 = "Timbermaw Hold" 989 = "Keepers of Time" 1351 = "The Brewmasters" 1440 = "Darkspear Rebellion" 1302 = "The Anglers" 1272 = "The Tillers" 1388 = "Sunreaver Onslaught" 529 = "Argent Dawn" 1106 = "Argent Crusade" 1387 = "Kirin Tor Offensive" 934 = "The Scryers" 942 = "Cenarion Expedition" 1376 = "Operation: Shieldwall" 577 = "Everlook" 1352 = "Huojin Pandaren" 1178 = "Hellscream's Reach" 1067 = "The Hand of Vengeance" 609 = "Cenarion Circle" 1353 = "Tushui Pandaren" 1242 = "Pearlfin Jinyu" 509 = "The League of Arathor" 1050 = "Valiance Expedition" 1345 = "The Lorewalkers" 530 = "Darkspear Trolls" 1068 = "Explorers' League" 1337 = "The Klaxxi" 935 = "The Sha'tar" 1359 = "The Black Prince" 1358 = "Nat Pagle" 1275 = "Ella" 1037 = "Alliance Vanguard" 54 = "Gnomeregan" 729 = "Frostwolf Clan" 1085 = "Warsong Offensive" 1228 = "Forest Hozen" 1204 = "Avengers of Hyjal" 1015 = "Netherwing" 1276 = "Old Hillpaw" 1038 = "Ogri'la" 1435 = "Shado-Pan Assault" 1052 = "Horde Expedition" 59 = "Thorium Brotherhood" 470 = "Ratchet" 1177 = "Baradin's Wardens" 1134 = "Gilneas" 1277 = "Chee Chee" 1271 = "Order of the Cloud Serpent" 1273 = "Jogu the Drunk" 730 = "Stormpike Guard" 1341 = "The August Celestials" 1133 = "Bilgewater Cartel" 1119 = "The Sons of Hodir" 510 = "The Defilers" 1278 = "Sho" 67 = "Horde" 68 = "Undercity" 69 = "Darnassus" 70 = "Syndicate" 1104 = "Frenzyheart Tribe" 72 = "Stormwind" 1283 = "Farmer Fung" 1279 = "Haohan Mudclaw" 92 = "Gelkis Clan Centaur" 76 = "Orgrimmar" 1073 = "The Kalu'ak" 1216 = "Shang Xi's Academy" 1105 = "The Oracles" 1375 = "Dominance Offensive" 890 = "Silverwing Sentinels" 1280 = "Tina Mudclaw" 21 = "Booty Bay" 1135 = "The Earthen Ring" 922 = "Tranquillien" 930 = "Exodar" 87 = "Bloodsail Buccaneers" 946 = "Honor Hold" 1158 = "Guardians of Hyjal" 1281 = "Gina Mudclaw" 589 = "Wintersaber Trainers" 978 = "Kurenai" 93 = "Magram Clan Centaur" 1091 = "The Wyrmrest Accord" 469 = "Alliance" 1064 = "The Taunka" 1124 = "The Sunreavers" 1282 = "Fish Fellreed" 1171 = "Therazane" 1094 = "The Silver Covenant" 1126 = "The Frostborn" 889 = "Warsong Outriders" 911 = "Silvermoon City" 947 = "Thrallmar" 910 = "Brood of Nozdormu" 1156 = "The Ashen Verdict" 1172 = "Dragonmaw Clan" 47 = "Ironforge" 1077 = "Shattered Sun Offensive" 1098 = "Knights of the Ebon Blade" 749 = "Hydraxian Waterlords" 1011 = "Lower City" 967 = "The Violet Eye" 990 = "The Scale of the Sands" 1173 = "Ramkahen" 1090 = "Kirin Tor" 809 = "Shen'dralar" 932 = "The Aldor" 81 = "Thunder Bluff" 349 = "Ravenholdt" 970 = "Sporeggar" } factionNameToId =
{ Stormpike Guard = 730 The Oracles = 1105 The Kalu'ak = 1073 Ratchet = 470 Ramkahen = 1173 Silvermoon City = 911 Sunreaver Onslaught = 1388 Orgrimmar = 76 Old Hillpaw = 1276 Undercity = 68 Gelkis Clan Centaur = 92 Emperor Shaohao = 1492 Kirin Tor Offensive = 1387 Darkspear Rebellion = 1440 Shado-Pan Assault = 1435 Dominance Offensive = 1375 Bilgewater Cartel = 1133 Kirin Tor = 1090 The Black Prince = 1359 Fish Fellreed = 1282 The Tillers = 1272 Tina Mudclaw = 1280 The Lorewalkers = 1345 Darnassus = 69 Shang Xi's Academy = 1216 Ashtongue Deathsworn = 1012 Gilneas = 1134 The Sha'tar = 935 Bloodsail Buccaneers = 87 Cenarion Circle = 609 Huojin Pandaren = 1352 Baradin's Wardens = 1177 The Scryers = 934 Golden Lotus = 1269 Sha'tari Skyguard = 1031 Alliance Vanguard = 1037 Everlook = 577 The Wyrmrest Accord = 1091 Hellscream's Reach = 1178 The Hand of Vengeance = 1067 Alliance = 469 Exodar = 930 Syndicate = 70 Knigh AddOns: Swatter, v<%version%> (<%codename%>) AddonFactory, v10.2.019 Altoholic, v10.2.020 DataStore, v2024.06.30 DataStoreAchievements, v2024.06.27 DataStoreAgenda, v2024.06.23 DataStoreAuctions, v2024.06.23 DataStoreCharacters, v2024.06.27 DataStoreContainers, v2024.06.26 DataStoreCrafts, v2024.06.26 DataStoreCurrencies, v2024.06.23 DataStoreGarrisons, v2024.05.20 DataStoreInventory, v2024.06.23 DataStoreMails, v2024.06.23 DataStorePets, v2024.05.20 DataStoreQuests, v2024.06.26 DataStoreReputations, v2024.06.24 BlizRuntimeLib v11.0.0.55818(EU) (ck=24a)

Cthutu commented 3 months ago

Is this being worked on? Currently I get a error dialog every time I teleport or start the game. Not sure which add-on I use is dependent on DataStore for me to disable it for now.

If it is being worked on, I'll just be patient and wait. Otherwise, I will start narrowing down which add on is causing it.

deksan commented 3 months ago

Seems that the function GetFactionById might be gone ??

Adding the folloiwng code before the AddFaction function seems to fix it :

-- Returns a list of faction data compatible with the deprecated GetFactionInfo and GetFactionInfoByID
    local GetFactionInfoWrapper = function(factionData)
        if factionData then
        return factionData.name, factionData.description, factionData.currentStanding, 0, 0, 0, factionData.atWarWith, factionData.canToggleAtWar, factionData.isHeader, factionData.isCollapsed, false, factionData.isWatched, factionData.isChild, factionData.factionID, factionData.hasBonusRepGain, false;
        end
        return nil;
    end

    -- Wrapper function for C_Reputation.GetFactionDataByID for the deprecated GetFactionInfoByID
    local GetFactionInfoByID = GetFactionInfoByID or function(factionId)
        return GetFactionInfoWrapper(C_Reputation.GetFactionDataByID(factionId));
    end