WeakAuras

WeakAuras

206M Downloads

Create new auras button missing on top of window

johndolotko opened this issue ยท 2 comments

commented

Description

Just recently, I have lost the buttons to create new weakauras and to import weakauras from the
top of the weakauras window as shown in the image attached.

Screenshot 2023-02-25 151307

I have tried the new alpha version but getting the same issue.

Weakauras.lau file
WeakAuras.zip

WeakAuras Version

WeakAuras 5.3.7

World of Warcraft Flavor

Retail (Default)

Tested with only WeakAuras

  • Yes
  • No

Lua Error

1x WeakAuras/AuraEnvironment.lua:359: attempt to index field 'child_envs' (a nil value)
[string "@WeakAuras/AuraEnvironment.lua"]:359: in function `ActivateAuraEnvironment'
[string "@WeakAuras/RegionTypes/DynamicGroup.lua"]:336: in function `sortFunc'
[string "@WeakAuras/RegionTypes/DynamicGroup.lua"]:1256: in function `SortUpdatedChildren'
[string "@WeakAuras/RegionTypes/DynamicGroup.lua"]:1064: in function `RunDelayedActions'
[string "@WeakAuras/RegionTypes/DynamicGroup.lua"]:1055: in function `Resume'
[string "@WeakAuras/WeakAuras.lua"]:1380: in function `ResumeAllDynamicGroups'
[string "@WeakAurasOptions/WeakAurasOptions.lua"]:733: in function <WeakAurasOptions/WeakAurasOptions.lua:697>

Reproduction Steps

Happens everytime

Last Good Version

No response

Screenshots

Screenshot 2023-02-25 151307

Export String

Unabme to paste weakauras.zip here so attached to description instead.
commented

I can repro error, it happen on Private.ActivateAuraEnvironment(data.id) in customSort func of Boneshock's Trackables aura

function(a, b)
  --ViragDevTool_AddData(a, "a")
  --ViragDevTool_AddData(b, "b")
  if a.region and a.region.state and a.region.state.expansion 
  and b.region and b.region.state and b.region.state.expansion 
  then
    --sort by name if expansion is equal
    if a.region.state.expansion == b.region.state.expansion then
      --sort by name
      if a.region.state.name and b.region.state.name then
        return a.region.state.name <= b.region.state.name
      end            
    else --sort by expansion
      return a.region.state.expansion > b.region.state.expansion
    end
  else --sort by groupIndex
    return a.dataIndex <= b.dataIndex
  end
end
commented

Boneshock's Trackables has 3 children

			["controlledChildren"] = {
				"Free Bagspace", -- [1]
				"Player Money", -- [2]
				"Currencies and Items", -- [3]
			},

Somehow when activating env of the group, current_aura_env.child_envs is set to nil when activating env of the second child Player Money which is not in environment_initialized table

Saving address of current_aura_env.child_envs before child'env'activation and restoring it after fixes the error

Proposed fix: d92b5c9
I'm not sure if it's best way to fix it