AceConfigDialog:BuildSortedOptionsTable: invalid order function for sorting #501


Closed
  • sparesimian created this issue Jun 23, 2019

    I'm using AdiBags and get this error when launching its config dialog with "/adibags". I threw some debug code into the AceConfigDialog module to dump out the three tables but I'm not fluent enough in Lua to just spot the error. Perhaps a Lua expert could look at the tables and see why the comparison isn't converging.

     

    Here's my debug code, replacing the tsort call:

     

       -- sort, catch any client error and dump for debugging
       local status, retval = pcall(tsort, keySort, compareOptions)
       if not status then
          print("AceConfigDialog:BuildSortedOptionsTable: " .. retval)
          -- dump tables to debug sort comparison function
          print("keySort:")
          table.foreach(keySort, print)
          print("tempOrders:")
          table.foreach(tempOrders, print)
          print("tempNames:")
          table.foreach(tempNames, print)
       end
    Here's the output of the above:

    keySort:
    1 Ancient Mana
    2 BoA
    3 Champion Equipment
    4 Item Enhancement
    5 Item Enhancement!
    6 Key
    7 Power
    8 Recipe
    9 Relic
    10 Junk
    11 Miscellaneous
    12 Trade Goods
    13 Equipment
    14 Consumable
    15 description
    16 Quest
    17 newAssoc
    18 New
    19 Tradeskill

     

    tempOrders:
    Ancient Mana 0
    description 1
    Champion Equipment 0
    Trade Goods 0
    Recipe 0
    BoA 0
    newAssoc 10
    Quest 30
    New 100
    Tradeskill 20
    Power 0
    Miscellaneous -20
    Equipment 10
    Consumable -10
    Item Enhancement 0
    Item Enhancement! 0
    Relic 0
    Junk -40
    Key 0

     

    tempNames:
    Ancient Mana Ancient Mana
    description Allow you manually redefine the section in which an item should be put. Simply drag an item on the section title.
    Champion Equipment Champion Equipment
    Trade Goods Trade Goods
    Recipe Recipe
    BoA BoA
    newAssoc New Override
    Quest Quest
    New New
    Tradeskill Tradeskill
    Power Power
    Miscellaneous Miscellaneous
    Equipment Equipment
    Consumable Consumable
    Item Enhancement Item Enhancement
    Item Enhancement! Item Enhancement!
    Relic Relic
    Junk Junk
    Key Key

     

  • sparesimian posted a comment Jun 25, 2019

    This will demonstrate the error in a standalone interpreter. (I couldn't get the issue attachment button to work. It just hangs when I click Upload.)

     

    https://pastebin.com/QrhUwHUK


    Edited Jun 25, 2019
  • sparesimian posted a comment Jun 25, 2019

    I think the following change at line 299 in compareOptions will fix it. I'm no longer getting the error. 

     

    - if OrderB > 0 then

    + if OrderB >= 0 then

     

  • nevcairiel posted a comment Jun 26, 2019

    Change makes logical sense to me, applied, thanks!

  • nevcairiel closed issue Jun 26, 2019

To post a comment, please login or register a new account.