Juser form plugin not synching calc fields

Discussion in 'Community' started by nrsmoll, Nov 19, 2017.

  1. nrsmoll

    nrsmoll Member

    Level: Professional
    I created a "Full Name" calc element that concatenates the first and last names.
    I tried using the calc field as the field I sync with the j! "names" field and this doesn't work, it doesn't sync. Turned on AJAX.

    I suspect that this cannot work, because the calc field cannot be a two way sync and that is probably why it won't work.

    Does anyone have a workaround?
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    When you say "not syncing", which way do you mean? It should work for creating users, but no, it probably wouldn't work if you have "sync on edit" turned on, because as you say, the calc isn't a "two way" thing, it's always going to use the values from your form in it's calculation.

    -- hugh
     
  3. nrsmoll

    nrsmoll Member

    Level: Professional
    It seems that when I create a new record in the main form, the "full_name" calc field does not transfer the information to the J! user form.
    The J! user is created, just without a name.

    So sync for the calc field doesn't work for fabrik -> J!.
    It works when I have the "first_name" as the field that the juser plugin works with.
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
  5. nrsmoll

    nrsmoll Member

    Level: Professional
    Hi,
    I imagine it is a really basic function, so I am also surprised it isn't working.
    I am doing exactly what you are doing on your screencast. That screencast could be placed in the fabrik wiki?

    It is my form 62. I just tried it, and J! user ID 24 is the id of the patient I created with the fabrik "Full_name" calc field set to sync with J! user "Name" field in the Juser plugin (In form 62). The J! user "Name" field is the field that seems to be empty.
     
  6. nrsmoll

    nrsmoll Member

    Level: Professional
    Just letting you know, it still isn't working. I have to sign patients up with just their first name.

    I've tried several times turning it off and on.
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    OK, I tried editing and saving an existing user (John Archibald) and it worked ... which gave me a clue ...

    You have the "Add" and "Edit" permissions set to "Registered" on your "Full Name" calc. Which of course means that when a guest submits the form to create their account, that element isn't accessible, so isn't included in the form data. Chicken, meet egg.

    I've set the ACL's for that element back to Public, it should now work.

    -- hugh
     
  8. nrsmoll

    nrsmoll Member

    Level: Professional
    OMG, you are right.

    Debugging checklist I'm building:
    1) Check all elements in question have appropriate access levels or they won't store/show.
    2) Check for rogue prefilters...
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Just FYI, you can set defaults on elements which users don't have access to, and that default will get submitted with the form (we encrypt the default value and add it as a hidden field). But because calc elements run after submission, rather than creating a default during page load, they won't work.

    -- hugh
     
  10. nrsmoll

    nrsmoll Member

    Level: Professional
    Nice thx. I have created a Wiki page called "Debugging Checklist". I'll expand it with time, but thought it would be good for other noobs like me. Save debugging time for you and others maybe too. If it doesn't fit with the wiki, thats ok too.
     
    cheesegrits likes this.

Share This Page