Closed ruuk closed 7 years ago
sys.listitem only exists for contextmenu add-ons, correct. Passing dbtype and listitem.dbid is indeed the cleanest solution here, so that would be my preferred solution (we can still remove the dialog.close() then ofc in case you want to deal with that on script-side)
Modified to pass in dbtype
and dbid
. Still removes the dialog.close()
Thx!
When the dialog is opened from the home window widgets and then closed before the add-on launches, there is no list item info available to the add-on.
This PR leaves the window open, so the add-on can close it after getting the info. It has the added benefit of providing the likely user expected behavior of returning to the info dialog if the add-on dialog is canceled.
If for some reason this solution does not make sense, an alternative would be to pass
ListItem.DBType
andListItem.DBID
to the add-on. I'm of course open to any other suggestions as well.Note: sys.listitem (as you've suggested in the past) does not work here (AttributeError) and hasn't worked for me yet. Perhaps it doesn't work for script add-ons?
Thanks!