Quantcast
Download
(3 Kb)
Download
Updated: 05/09/20 05:02 AM
Compatibility:
Harrowstorm (5.3.4)
Updated:05/09/20 05:02 AM
Created:05/09/20 05:02 AM
Monthly downloads:82
Total downloads:195
Favorites:3
MD5:
Aenathel's String Search Fix
Version: 1.0.0
by: Aenathel [More]
This add-on fixes a bug in the ZO_StringSearch.Process function that can break the UI completely.

This is currently only necessary if you use an add-on that enables the inventory search box, such as Votan's Search Box.
Optional Files (0)


Post A Reply Comment Options
Unread 05/10/20, 08:37 AM  
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 22
Uploads: 3
Votan has published a new version of Votan's Search Box, v1.7.8, that includes a more robust version of my fix. So this shouldn't be needed any longer, unless someone encounters the issue without using Votan's Search Box, which I doubt will happen.
Report comment to moderator  
Reply With Quote
Unread 05/09/20, 08:49 AM  
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 22
Uploads: 3
Originally Posted by Baertram
Where and how am I able to produce the error which your patch here fixes?
I mean what do I need to enter in the search box (Votans or ZOs standard inventory search -> enabled via LibCommonInventoryFilters e.g.).
Thanks for the info.
It's difficult to reproduce, as it happens randomly, but has something to do with missing search data on quest items. What you enter doesn't matter, the code breaks before it ever considers the search terms.

Here's my original post in the comments of Votan's Search Box (I would permalink, but haven't found a way to do that):

Originally Posted by Aenathel
Originally Posted by Tonyleila
sadly this addon is causing my whole UI to lock up and hide untill I reload. It has to be an issue together with another addon like https://www.esoui.com/downloads/info...isfreezed.html and https://www.esoui.com/downloads/info...y-Revised.html

happens when you search for something and don't remove the search word before closing the window. then something changes (e,g, new loot) and you reopen the bag/bank = ui hidden
This started happening to my wife (and very rarely, myself), so I have just spent two hours tracking this down based on the information in this thread plus error notifications from my wife.

This is going to sound crazy, but this actually appears to be a bug in the ESO UI code itself. It has nothing to do with Votan's Search Box directly, but because said functionality is only ever used if you have an add-on that enables the search box, well, few people (if any) actually get this without the add-on.

The issue is that quest items/quest tools, which exist in a special quest inventory data structure (basically the items you can see on the quest tab in your inventory), are sometimes missing important information about how to search them. (Technically, this is called searchData in the ESO UI code.)

When this data is missing, this ultimately triggers an error in ZO_StringSearch:Process, where a nil value ends up being called as a function. This part of the UI is not very resistant to errors, so the whole thing breaks.

I believe that the following snippet will fix the problem, at least it has worked on my wife's computer and I don't think there is much risk in adding this, as the functionality is (to my knowledge) only used if you're using this add-on:

Lua Code:
  1. do
  2.   local ZO_StringSearch_Process = ZO_StringSearch.Process
  3.  
  4.   ZO_StringSearch.Process = function(self, data, searchTerms)
  5.     -- If we don't know which type this is, well, it could be anything. But it's
  6.     -- probably a quest item or quest tool based on the error that happens if
  7.     -- this fix is not included. Now, hiding these items wouldn't help, so we
  8.     -- return true to indicate a match. Users will see an item potentially not
  9.     -- matched by their search terms, but the alternative is a broken UI.
  10.     if data.type == nil then return true end
  11.  
  12.     return ZO_StringSearch_Process(self, data, searchTerms)
  13.   end
  14. end

Basically, this replaces the ZO_StringSearch.Process function with one that knows that the searchData (data in this function) might be missing its type. In that case, it just returns true, causing the item to be displayed no matter if it actually matches the search terms or not.

I hope this helps!
Last edited by Aenathel : 05/09/20 at 08:50 AM.
Report comment to moderator  
Reply With Quote
Unread 05/09/20, 07:32 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2964
File comments: 3581
Uploads: 62
Where and how am I able to produce the error which your patch here fixes?
I mean what do I need to enter in the search box (Votans or ZOs standard inventory search -> enabled via LibCommonInventoryFilters e.g.).
Thanks for the info.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: