QueryAuctionItems causes error in Blizzard_AuctionUI.lua
QueryAuctionItems() full scan (equivalent of getAll) returns error
Running the following if you can run a full scan (as checked by CanSendAuctionQuery()) wil lthrow an error To reporduce: Have no addons loaded Open Auciton house In chat run /run QueryAuctionItems( "", nil, nil, 0, 0, 0, true, false, nil ) wait... Will return the following error example (this was taken from the live servers, results may be different) Code:
aceBlizzard_AuctionUI\Blizzard_AuctionUI.lua:733: attempt to index local 'color' (a nil value) |
Some items return -1 as quality, that's why this error happens.
|
Quote:
color = ITEM_QUALITY_COLORS[quality]; would error out. I would still consider this a bad bug on their part. Why would quality ever return as -1 anyway? It makes no sense because in UIParent.lua the table array for ITEM_QUALITY_COLORS is ITEM_QUALITY_COLORS = { }; for i = 0, NUM_LE_ITEM_QUALITYS - 1 do ITEM_QUALITY_COLORS[i] = { }; ITEM_QUALITY_COLORS[i].r, ITEM_QUALITY_COLORS[i].g, ITEM_QUALITY_COLORS[i].b, ITEM_QUALITY_COLORS[i].hex = GetItemQualityColor(i); ITEM_QUALITY_COLORS[i].hex = "|c"..ITEM_QUALITY_COLORS[i].hex; end So it should not even be possible to return quality as -1 LE_ITEM_QUALITY_POOR=0 LE_ITEM_QUALITY_COMMON=1 LE_ITEM_QUALITY_UNCOMMON=2 LE_ITEM_QUALITY_RARE=3 LE_ITEM_QUALITY_EPIC=4 LE_ITEM_QUALITY_LEGENDARY=5 LE_ITEM_QUALITY_ARTIFACT=6 LE_ITEM_QUALITY_HEIRLOOM=7 LE_ITEM_QUALITY_WOW_TOKEN=8 NUM_LE_ITEM_QUALITYS=9 So that array is saying from 0 to (9-1) so the indices range from 0 to 8 which is what is returned in the quality return... Either way quality should never return -1 because it would cause color = ITEM_QUALITY_COLORS[quality]; to have an empty result which is what happens and why itemName:SetVertexColor(color.r, color.g, color.b); then dies They need a check that says if quality is less than 0 set it to 0 or fix whatever allows it to return -1 |
More observations:
In Blizzard's AuctionUI.lua The initial value of that drop down is set by Code:
function BrowseDropDown_OnLoad(self) color = ITEM_QUALITY_COLORS[quality]; |
Even more fun
If I try and run Code:
/dump AuctionCategories[AuctionFrameBrowse.selectedCategoryIndex].subCategories[AuctionFrameBrowse.selectedSubCategoryIndex].subCategories[AuctionFrameBrowse.selectedSubSubCategoryIndex].filters I get the error (this is with the auction house open to browse and no categories selected): Code:
1x [string "return AuctionCategories[AuctionFrameBrowse..."]:1: attempt to index field '?' (a nil value) Code:
Dump: value=AuctionCategories[AuctionFrameBrowse.selectedCategoryIndex].subCategories[AuctionFrameBrowse.selectedSubCategoryIndex].subCategories[AuctionFrameBrowse.selectedSubSubCategoryIndex].filters Even just running /dump AuctionCategories[AuctionFrameBrowse.selectedCategoryIndex].filters does it without a category selected. So therefore, is this code the bug? Code:
local filterData; |
Lastly, the changes to queryAuctionItems in 7.0 are this (3 items merged into one, removed, and placed at the end)
pre 7.0 QueryAuctionItems(text, minLevel, maxLevel, invType, class, subclass, page, usable, rarity, false, exactMatch); now QueryAuctionItems(text, minLevel, maxLevel, page, usable, rarity, false, exactMatch, filterData); So invType, class, subclass were rolled into filterData and the new value is nil for not filtering categories. That false you see above in both code is the GetALL argument that has not changed. it is a boolean value where true means scan all auction items and return a single page mass query (able to be done every 15 minutes or when CanSendAuctionQuery() returns true,true) and false is the normal 50 items per page query results. So from a script stand point, the arguments themselves have not changed, only been slightly moved around. To check the returns of some of these arguments, you can do these dumps in game to find the value. Open the AH and at browse, run any of these to see the default value or the selected value corresponding to the arguments that QueryAuctionItems() can accept /dump BrowseName:GetText() /dump BrowseMinLevel:GetNumber() /dump BrowseMaxLevel:GetNumber() /dump AuctionFrameBrowse.selectedCategoryIndex /dump AuctionFrameBrowse.selectedSubCategoryIndex /dump AuctionFrameBrowse.selectedSubSubCategoryIndex /dump AuctionFrameBrowse.page /dump IsUsableCheckButton:GetChecked() /dump UIDropDownMenu_GetSelectedValue(BrowseDropDown) /dump ExactMatchCheckButton:GetChecked() This is the code that builds the filter value(s) for filterData Code:
local filterData; Here are what those variables equate to: categoryIndex = AuctionFrameBrowse.selectedCategoryIndex subCategoryIndex = AuctionFrameBrowse.selectedSubCategoryIndex subSubCategoryIndex = AuctionFrameBrowse.selectedSubSubCategoryIndex |
If you want to do a full scan single page query using the default entries of objects on the browse tab, this is the long form code for QueryAuctionItems()
Code:
QueryAuctionItems(BrowseName:GetText(), BrowseMinLevel:GetNumber(), BrowseMaxLevel:GetNumber(), AuctionFrameBrowse.selectedCategoryIndex, AuctionFrameBrowse.selectedSubCategoryIndex, AuctionFrameBrowse.selectedSubSubCategoryIndex, AuctionFrameBrowse.page, IsUsableCheckButton:GetChecked(), UIDropDownMenu_GetSelectedValue(BrowseDropDown), ExactMatchCheckButton:GetChecked()) This pulls the code out of line 431 of the AuciotnUI.lua file from the function AuctionFrameBrowse_Search(), passing to the local function AuctionFrameBrowse_SearchHelper() - this is what contains QueryAuctionItems() and what passes arguments to it. |
Small update. Ran a full scan test on the Beta servers and there was no error so either something is fixed back end or there is a flag/index/header/ etc not enabled on live that is throwing off this (like artifact color?)
Granted there were only 12,000 items on beta, I ran a test on a very low pop Brazilian server that only had 7,000 items on the AH and it threw the error as well. |
All times are GMT -6. The time now is 04:25 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI