View Single Post
07/14/22, 11:54 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
To all addon devs:
If you get this error message
Code:
Load[/EsoUI/Libraries/ZO_Templates/EditBoxTemplates_Keyboard.xml(xxxx)] (inherits): Error: Unable to find virtual object [ZO_EditDefaultText].
One of your addons is inheriting (XML inherits="....") from ZO_EditDefaultText which is deprecated!

ZOsDanBatson already told us that the editbox was changed and the default text is handled differently now.
Please remove the inheritance to ZO_EditDefaultText in your code as it is pointless after PTS was set live.

The error message currently was not meant to show and there might be a fix incoming, but removing the inheritance should be best to do here!

Many addons which use an editbox are effected, also popular ones like Dolgubons Lazy Set Crafter, InentoryInsightFromAshes, WishList, DebugLogViewer, ...


Edit - Feedback from ZOsDanBatson:
When I'm done merging in my fixes for my broken attempts at compat alias, in theory the function ZO_EditDefaultText_Initialize and inheriting from ZO_EditDefaultText will still have the same overall effect.

But that's a harder (and deprecated) way to do it!
Instead, the new way to do it is this:
Lua Code:
  1. <Controls>
  2.   <EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop" defaultText="Filter by text search">
  3.     <OnTextChanged>IIfA:GuiOnSearchboxText(self)</OnTextChanged>
  4.   </EditBox>
  5. </Controls>

In most vanilla code, we used to have to call ZO_EditDefaultText_OnTextChanged from any edit boxes that registered for OnTextChanged (typically searches).
But ZO_EditDefaultText_OnTextChanged no longer does anything (it's just an empty stubbed function in compat alias to prevent UI errors now) .

So you can stop calling that, too!
Conclusion
So we should folow the new way and change our addons accordingly if we update the addons in question the next time:
-Remove
Code:
inherits="...ZO_EditDefaultText"
and replace with new attribute
Code:
defaultText="Default text for empty editbox"
in XML
-Stop calling function
Code:
ZO_EditDefaultText_OnTextChanged
in our XML/lua code as it does nothing

Important:
If you remove the inheritance to ZO_EditDefaultText and call the function ZO_EditDefaultText_Initialize the function will raise a nil error because the default text label is missing then. So if you prepare a live & PTS version you need to add a check to the XML code like

Code:
<OnInitialize>
If GetAPIversion() >= 101035 then
ZO_EditDefaultText_Initialize(self, ...)
end
</OnInitialize>

Last edited by Baertram : 07/19/22 at 01:03 AM.
  Reply With Quote