Copy link to clipboard
Copied
In SDK 3.0, a numeric edit_field control can easily get into an infinite loop of popping up an "Invalid numeric entry" message, and the user is forced to kill LR using the task manager.
To reproduce:
1. Run the test plugin below.
2. Click in another (non-Lightroom) window. Depending on the arrangement of windows, the "Invalid numeric entry" message pops up below the main LR window, invisible to the user.
3. Click back in the edit_field of the plugin.
At this point, the "Invalid numeric entry" message is visible, and clicking OK just brings it up again. You've got to use the task manager to kill Lightroom.
The plugin code:
local LrDialogs = import 'LrDialogs'
local f = import 'LrView'.osFactory()
LrDialogs.presentModalDialog {
title = "Test",
contents = f:edit_field {min = 1}}
I've submitted this via the Web form but posted it here in case others encounter similar symptoms.
Copy link to clipboard
Copied
I just encountered the same bug by exiting the "Vignetting" field. Looks like the validation code fails to restore the default value to the vignetting variable. However, I had intended to leave a value of 120 in that field, and I believe the error emerged when I clicked onto the gray panel behind the image I am working on.
Either I finally broke out of the loop by pressing <esc> followed by a number, or the validation code grew bored with the game. For some reason, after 15-20 tries at ending the loop, it stopped. Sorry for the poor documentation.
Copy link to clipboard
Copied
A bug, for sure, but you should be able to work around it by providing your own validate function.
local LrDialogs = import 'LrDialogs'
local LrView = import 'LrView'
local f = LrView.osFactory()
LrDialogs.presentModalDialog {
contents = f:edit_field {
min = 1,
validate = function(view, value)
if value ~= nil and type(value) == 'number' then
return true, value
end
return false, value, 'some message'
end
}
}
Copy link to clipboard
Copied
Right, thanks.