Thread Tools Display Modes
03/20/21, 09:05 AM   #1
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 132
Originally Posted by votan View Post
gsub returns two values: the changed string and the replacement count.
SetText takes two parameters. But the second must be boolean. gsub returns int. => boom
You can not directly use gsub and SetText in one operation.
=>
Lua Code:
  1. local value = gsub(...) -- take first return value only.
  2. edit:SetText(value)
This was used as-is up until the last patch without issue. I assume gsub() is the same, so unless SetText() was changed - do you know that it was? - the other option is the string operation. Either way, breaking-changes without a notification is rough.
 
03/20/21, 03:56 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,581
Originally Posted by Phuein View Post
This was used as-is up until the last patch without issue. I assume gsub() is the same, so unless SetText() was changed - do you know that it was? - the other option is the string operation. Either way, breaking-changes without a notification is rough.
That's not a breaking change - the addon code was just written naively.
Regardless of language or project, one should never pass variable returns directly into functions that are maintained by a third party. Otherwise there will be surprises like that in case the function is updated to accept new arguments.
 

ESOUI » Developer Discussions » Bug Reports » [notabug] SetText() with gsub operation crashes game


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off