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

Weakauras changed global function "AbbreviateNumbers" #4812

Closed
2 tasks done
fingershi opened this issue Jan 18, 2024 · 1 comment
Closed
2 tasks done

Weakauras changed global function "AbbreviateNumbers" #4812

fingershi opened this issue Jan 18, 2024 · 1 comment
Labels
⏱ Awaiting Response This ticket hasn't been triaged yet. 🐛 Bug This is a problem with WeakAuras.

Comments

@fingershi
Copy link

fingershi commented Jan 18, 2024

Is there an existing issue for this?

  • I have searched the existing open and closed issues.

Description

In Types.lua, the codes below changes the global function AbbreviateNumbers
https://github.com/WeakAuras/WeakAuras2/blob/1be6f9ad0f7740cc122896d54743173e6ea9c6e1/WeakAuras/Types.lua#L157C1-L190

if gameLocale == "koKR" or gameLocale == "zhCN" or gameLocale == "zhTW" then
  -- Work around https://github.com/Stanzilla/WoWUIBugs/issues/515
  --
  local NUMBER_ABBREVIATION_DATA_FIXED={
    [1]={
      breakpoint = 10000 * 10000,
      significandDivisor = 10000 * 10000,
      abbreviation = SECOND_NUMBER_CAP_NO_SPACE,
      fractionDivisor = 1
    },
    [2]={
      breakpoint = 1000 * 10000,
      significandDivisor = 1000 * 10000,
      abbreviation = SECOND_NUMBER_CAP_NO_SPACE,
      fractionDivisor = 10
    },
    [3]={
      breakpoint = 10000,
      significandDivisor = 1000,
      abbreviation = FIRST_NUMBER_CAP_NO_SPACE,
      fractionDivisor = 10
    }
  }

  AbbreviateNumbers = function(value)
    for i, data in ipairs(NUMBER_ABBREVIATION_DATA_FIXED) do
      if value >= data.breakpoint then
              local finalValue = math.floor(value / data.significandDivisor) / data.fractionDivisor;
              return finalValue .. data.abbreviation;
      end
    end
    return tostring(value);
  end
end

It causes ADDON_ACTION_FORBIDDEN when changing guild rank of a member.
The code only takes effect if game locale is KR, CN or TW.

WeakAuras Version

WeakAuras 5.9.1

World of Warcraft Flavor

Retail (Default)

World of Warcraft Region

TW/Asia

Tested with only WeakAuras

  • Yes

Lua Error

20x [ADDON_ACTION_FORBIDDEN] 插件 'WeakAuras' 尝试调用保护功能 'SetGuildRankOrder()'。
[string "@!BugGrabber/BugGrabber.lua"]:481: in function <!BugGrabber/BugGrabber.lua:481>
[string "=[C]"]: in function `SetGuildRankOrder'
[string "@Blizzard_Communities/GuildRoster.lua"]:174: in function `func'
[string "@SharedXML/UIDropDownMenu.lua"]:1009: in function `UIDropDownMenuButton_OnClick'
[string "*UIDropDownMenuTemplates.xml:131_OnClick"]:1: in function <[string "*UIDropDownMenuTemplates.xml:131_OnClick"]:1>

Locals:
_ = Frame {
 RegisterEvent = <function> defined @!BugGrabber/BugGrabber.lua:487
 0 = <userdata>
 UnregisterEvent = <function> defined @!BugGrabber/BugGrabber.lua:487
 SetScript = <function> defined @!BugGrabber/BugGrabber.lua:487
}
event = "ADDON_ACTION_FORBIDDEN"
events = <table> {
 ADDON_ACTION_BLOCKED = <function> defined @!BugGrabber/BugGrabber.lua:553
 ADDON_ACTION_FORBIDDEN = <function> defined @!BugGrabber/BugGrabber.lua:553
 PLAYER_LOGIN = <function> defined @!BugGrabber/BugGrabber.lua:547
 LUA_WARNING = <function> defined @!BugGrabber/BugGrabber.lua:562
 ADDON_LOADED = <function> defined @!BugGrabber/BugGrabber.lua:507
}

Reproduction Steps

Change a guild rank of some members

Last Good Version

WeakAuras 5.8.7-44-g78b941f(alpha)

Screenshots

No response

Export String

No response

@fingershi fingershi added the 🐛 Bug This is a problem with WeakAuras. label Jan 18, 2024
@github-actions github-actions bot added the ⏱ Awaiting Response This ticket hasn't been triaged yet. label Jan 18, 2024
@InfusOnWoW
Copy link
Contributor

Ah that was unintentionally, thanks for the report.

InfusOnWoW added a commit to InfusOnWoW/WeakAuras2 that referenced this issue Jan 18, 2024
@mrbuds mrbuds closed this as completed in d984e55 Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏱ Awaiting Response This ticket hasn't been triaged yet. 🐛 Bug This is a problem with WeakAuras.
Projects
None yet
Development

No branches or pull requests

2 participants