IsDisabledByParentalControls Taint

UI and Macro
I am not sure where this belongs so I am submitting this issue here and in the UIMacros forum.

As of 5.4.1 a call to the secure function C_StorePublic.IsDisabledByParentalControls() has been added to the UpdateMicroButtons() function. Because UpdateMicroButtons is called during the OnShow and OnHide events of over 30 frames, anything that touches those frames will cause taint errors. This includes adding addon options to the interface panel.

To test this I created the following simple addon whose only purpose was to add an entry to the InterfaceOptions panel. I then disabled all other addons and opened WoW.

TestAddon.toc
## Interface: 50400
## Title: TestAddon
## Version: 2.0.50400
TestAddon.lua

TestAddon.lua
MyAddon.childpanel = CreateFrame( "Frame", "MyAddonChild", MyAddon.panel);
MyAddon.childpanel.name = "MyChild";
MyAddon.childpanel.parent = MyAddon.panel.name;
InterfaceOptions_AddCategory(MyAddon.childpanel);

At first I could open and close the WorldMap without error, however once I opened the interface option panel any attempt to open the WorldMap, or any other frame touched by this, threw the following error:

Error: AddOn TestAddon attempted to call a forbidden function (IsDisabledByParentalControls()) from a tainted execution path.

It is so bad that even macros that simply change a frames state (ie /run WorldMapFrame_ToggleWindowSize()) will cause this taint error to appear.

While code cleanup does solve some of the causes of this problem, I don't think addon authors are going to be able to eliminate it on their own. I believe Blizzard is going to have to fix their code by either changing C_StorePublic.IsDisabledByParentalControls() to a non-secure function, or by assigning its value to a variable when WoW loads and just reference that variable in UpdateMicroButtons().
Also getting this error, quite frequently too. At first I thought it was just one of my addons, until it started happening with just about anything I tried to do.

Hoping for a quick fix.
Me too !
Can confirm I'm having this issue as well. None of my addons changed from 5.4 -> 5.4.1.
Having the same problem as well.
10/29/2013 08:58 PMPosted by Lothrik
None of my addons changed from 5.4 -> 5.4.1.

There appear to have been several undocumented changes to the addon API that have been made without a bump to the API/TOC version. It's 'sort of' a problem with those addons, but it's also rather sloppy on Blizzard's part.

I know Blizzard has a habit of making undocumented changes to the API, but usually they're at least kind enough to bump the TOC version to prevent addons that may not work properly with the changes from loading initially.
For now a temporary fix I'm using to avoid getting annoying errors is this:

/run C_StorePublic.IsDisabledByParentalControls = function () return false end

Kind of funny that you can overwrite a secure function with an insecure one, IMO.
They up and remove GetCVar("realmName") and poked at UpdateMicroButtons() too? Come on Blizzard, patches are for fixing errors, not changing the API.
For now a temporary fix I'm using to avoid getting annoying errors is this:

/run C_StorePublic.IsDisabledByParentalControls = function () return false end

Kind of funny that you can overwrite a secure function with an insecure one, IMO.


Worked like a charm, made a quick add-on to run that on log-in and haven't had any issues since.

Thank you!
As an addon author whose addons are affected by this hopefully-unintentional change, I would really like to know if Blizzard is planning to fix this sloppiness soon, or whether addon authors are expected to go to heroic lengths to work around the issue. I suspect in some cases it may not even be possible to work around this without breaking the in-game store or other parts of the UI. I believe the one-liner proposed in an earlier comment has both these nasty side-effects, as it silently taints alot more of the FrameXML code paths, leading to other problems (such as taint errors when changing talients).

I agree with the OP that C_StorePublic.IsDisabledByParentalControls() should probably be changed to a non-protected function. In addition, it would be nice to remove some of the useless calls to UpdateMicroButtons() in modules that no longer have corresponding micro buttons (eg MapFrame, RaidFrame, MacroFrame etc), as that's whats causing the taint to spread so far.

/run C_StorePublic.IsDisabledByParentalControls = function () return false end


At least this solution gives me a moment of peace everytime i'm checking the map for now
Thanks man.
For now a temporary fix I'm using to avoid getting annoying errors is this:

/run C_StorePublic.IsDisabledByParentalControls = function () return false end



Again, this is NOT a good solution to the problem, and should not be recommended to anyone. It does silence the error, but it ALSO taints the Talent window so you can no longer change talents. It also taints many other frames in your UI, breaking them in subtle ways.

Blizzard needs to fix this on their side. Naive, user-side hacks for taint problems just make the problem worse. This one replaces an annoying but harmless error message with a broken UI.
One solution I found, written by Nevcairiel for Mapster, has not caused any taint AFAIK. I modified it to work with both the PetJournalParent and AchievementFrame frames, however this code has to be called after the corresponding Blizzard addon that creates the frame has been loaded.

WorldMapFrame:
setfenv(WorldMapFrame_OnShow, setmetatable({UpdateMicroButtons=function() end }, { __index = _G}))

AchievementFrame: (Can only run after Blizzard_AchievementUI is loaded)
setfenv(AchievementFrame_OnShow, setmetatable({UpdateMicroButtons=function()
if (AchievementFrame and AchievementFrame:IsShown()) then
AchievementMicroButton:SetButtonState("PUSHED", 1);
end
end }, { __index = _G}))

PetJournalParent: (Can only run after Blizzard_PetJournal is loaded)
setfenv(PetJournalParent_OnShow, setmetatable({UpdateMicroButtons=function()
if (PetJournalParent and PetJournalParent:IsShown()) then
CompanionsMicroButton:Enable();
CompanionsMicroButton:SetButtonState("PUSHED", 1);
end
end }, { __index = _G}))
10/30/2013 06:59 AMPosted by Rotule
One solution I found, written by Nevcairiel for Mapster, has not caused any taint AFAIK. I modified it to work with both the PetJournalParent and AchievementFrame frames, however this code has to be called after the corresponding Blizzard addon that creates the frame has been loaded.


Note this solution is only safe for frames that do not contain any Secure frame elements. If you try to use in, for example, the RaidFrame, it will cause errors in combat.
10/29/2013 09:44 PMPosted by Bor
I know Blizzard has a habit of making undocumented changes to the API, but usually they're at least kind enough to bump the TOC version to prevent addons that may not work properly with the changes from loading initially.


I believe they did this. I checked my list of add-ons after downloading 5.4.1 and logging in to the client. 14 of them were labeled as out-of-date and were not set to load. The biggest offenders - CTMod et al and Chatter - are in that group.

This whole situation has me scratching my head. Everything feels haphazard.
10/30/2013 06:40 PMPosted by Aliok
I believe they did this.

Nope, the TOC is still at 50400. The addons marked out of date are likely the ones that are still on the 50300 TOC, as the checkbox for loading out of date addons is reset with every patch.
You can always just disable the errors popups:
/run StaticPopupDialogs["ADDON_ACTION_FORBIDDEN"] = nil
This kind of oversight and lack of response is the type of disrespect from Blizzard that causes addon authors to abandon their projects...
This kind of oversight and lack of response is the type of disrespect from Blizzard that causes addon authors to abandon their projects...


touche - interesting how in this thread with participants who are familiar with modding & api changes there is no answer - yet in another thread with participants who are obviously standard players they respond with a canned response to delete their wtf/cache/interface folders without telling them the ramifications of doing so - GREAT customer service Blizzard.
nothing yet ?

Join the Conversation

Return to Forum