Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bug: Infinite "Invalid numeric entry" loop with numeric edit_fields

LEGEND ,
Jul 04, 2010 Jul 04, 2010

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.

TOPICS
SDK
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 03, 2010 Aug 03, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 04, 2010 Aug 04, 2010

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
    }
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 04, 2010 Aug 04, 2010
LATEST

Right, thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines