This topic is locked

Work Around for lookup wizard dependent drop down box problem with add

5/26/2009 4:38:42 AM
PHPRunner General questions
M
MikeB941 author

PHPRUNNER 5.0 BUILD 766
This one took me a couple of hours to figure out.
Here's when this bug (I believe it's a bug) will show up:

  1. You have a DEPENDENT dropdown box setup through the lookup wizard
  2. You have checked "Allow to add new values on the fly"
  3. *** You have the SAME table that's the DEPENDENT table in your dropdown box ALSO setup as a DETAIL table in a master->detail relationship (not uncommon).
    If the user at any time goes down the master->detail path mentioned in item 3, the mastertable and masterkey1 $_SESSION variables will get set for the detail/dependent table. Once this happens, it for some reason persists and OVERRIDES the correct masterkey setting when using the corresponding dependent dropdown box to add new values on the fly.
    The symptom is when you're adding new values on the fly the category control will not work properly and instead will be overridden by whatever THE LAST VALUE WAS in the detail/dependent table's masterkey1 when it was set by the user going down the master->detail path as mentioned in item 3.
    When you're not adding values, everything looks fine. Everything will work properly with the "test it" button and there will be no problems as long you're selecting existing values. The problem only comes up when adding new values on the fly in this scenario.
    The WORK AROUND I'm using is to clear the mastertable and masterkey1 $_SESSION variables for the detail/dependent table in the Edit page: Before process event IN THE TABLE WHERE YOU HAVE THE DEPENDENT DROP DOWN BOXES:

$_SESSION["DependentTableName_mastertable"]="";

$_SESSION["DependentTableName_masterkey1"]="";


I hope this is of help if anyone else has run into this. Take Care.... Mike.

J
Jane 5/26/2009

Mike,
thank you for pointing me to this bug.

We'll fix it in the next version.