1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Labels of non-public elements showing on form.

Discussion in 'Community' started by aijosh, Jul 6, 2018.

  1. aijosh

    aijosh Member

    Level: Community
    I have a form that I need to register two different types of members.
    Regular Members with 7 elements and Advance members with 20 elements.

    I want to present the same form on the website's registration page. But after Regular registration, advance users can now access the remaining elements and fill in the form as required.

    I have setup the form with all the elements and changed the access level of advance element to 'registered'.

    Problem: All the labels of elements with access level 'registered' still show on the form even though they cannot be filled by public. I was going to hide the labels using CSS but realized they'll end up hidden too when the advance users need to fill the form.

    How do I solve this?
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    I can't replicate.
    Which Fabrik/Joomla version are you running? (This is the totally outdated J!2.5/Fabrik3.0 forum)
     
  3. aijosh

    aijosh Member

    Level: Community
    Last edited: Jul 6, 2018
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    View attachment 17312
    use
    View attachment 17313
    What did you set exactly?
    You must set add/edit/details (and list) access if a guest should not see an empty field (i.e. the label).
     
  5. aijosh

    aijosh Member

    Level: Community
    Ok. I'll note the forum from now.

    Please see link in my previous post showing screenshots
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    Details view is Public, so everybody is seeing the element readonly.
     
  7. aijosh

    aijosh Member

    Level: Community
    hmmm. Ok. I guess this is how it is programmed to work.

    But this is not the detail view. This is the form view.

    Is there a way to solve this?

    I tried creating a duplicate form but found out the database tables were also duplicated hence creating issues. I need the two forms to populate the same table.
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    If you are copying your list you'll get a new "set" list/form/groups... working on the same DB table.
     
  9. aijosh

    aijosh Member

    Level: Community
    Yes. Thats what I assumed and was going to continue using that but noticed the data submitted using the duplicated form didn't reflect in the original list.

    Both lists had different data in them.

    I initially had this collation headache which since I started double checking and the collation was the same on both lists. So I'm wondering why the lists dont talk to themselves. I'll have to recheck but I think the raw database itself had data from the two list. But on the front end each list shows only the data added via its form only.

    This is an issue since its a registration table and the user ids e.t.c. must be unique. Since list one cannot communicate with list two, the unique ids cannot be double checked
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    When you copy a list, it definitely uses the same underlying table, and unless you have some kind of pre-filtering, it'll show the same data.

    -- hugh
     
  11. aijosh

    aijosh Member

    Level: Community
    I'm rather sure the data on the lists were different.
    I didn't create any filters yet.

    I have deleted the duplicate list/forms e.t.c. so I'll have to create another duplicate to replicate the issue. I'll do this and revert here.

    But is this the best route to go (I mean creating a duplicate form/list/group)?
    Wouldn't just hiding the elements from the form view be a simple and ok route for this solution?
     
  12. aijosh

    aijosh Member

    Level: Community
    Ok. Tested again and it works fine. Same data in both list

    I still think simply hiding the elements from the form view is the best route for this solution.
    I can see me needing to add plugins to second form separately every time I need to add plugins to the first form. This seems like double work. The other option is to delete the duplicate form and do a new duplicate each time I add a plugin to the main form (this would also be an issue if the form is already attached to a menu item)

    Except this is a bug with my setup I think fabrik should look into this functionality.
     
  13. aijosh

    aijosh Member

    Level: Community
    :( I can see how it seems ok the way it currently works. I have some forms that I see would not work as planned if the elements are totally removed.
    There should be a meeting point for this two different scenarios which now currently share the same setting.

    I think a third option Form (view) should be available in the access tab. This solves the problem as form view is currently set by detail view BUT I might want someone to be able to view details but not form
     
  14. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'm not entirely sure what problem you are trying to solve.

    If it is:

    ... such that you have some elements which simply don't show when registering, and only show to registered users, then just setting the add/edit and details permissions to Registered should do that. Unregistered users won't see those elements at all (they'll be assigned whatever their default values are, and added as encrypted, hidden elements on the form), but once registered they will be able to see and edit them.

    Alternatively, you could copy the list, which gets you a separately configurable set of list/form/group(s)/elements, and unpublish the elements you don't want in the registration copy (or put them all in one group and hide that group in the group settings), and set up your menus so guests see one link and registered see another.

    When I do this kind of "two version of a registration / profile form" thing, I typically use a copy, simply because as time goes by, I almost always find other differences, like different plugins that need running, that is just easier if you have separately configurable copies of it.

    -- hugh
     
  15. aijosh

    aijosh Member

    Level: Community
    This is what I did.

    The labels are still rendered on the form.
    See link https://www.dropbox.com/s/8j18y1enoh4kcwn/c2.PNG?dl=0

    See permission of elements I did not want rendered but got rendered.
    https://www.dropbox.com/s/x13bqxvze23an2u/c1.PNG?dl=0

    I'm currently running the same plugins on the forms so duplicating isn't what I would prefer. Duplicating is actually more of a problem for me right now than a solution so I would prefer not to do a duplicate
     
  16. aijosh

    aijosh Member

    Level: Community
    Could this be added to fabrik? I'm sure other people would have needed this at some point but ended up finding a workaround.
     
  17. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Nope, it's not what you did:

    You left the 'details' permission (which is effectively "read only" permission) as Public.

    If when adding/editing a form a user doesn't have add/edit permission, but does have 'details view' permission, they'll see a read-only view of the element.

    To hide it entirely you have to remove "write" (add/edit) and "read" (details) permissions. Just like a file system. If I don't have write but do have read access, I can still see the file.

    Set details permission to registered, and they won't see it at all.

    -- hugh
     
  18. aijosh

    aijosh Member

    Level: Community
    Ok. I skipped the detail part of your initial response.

    In any case
    It is a public record so setting view access to registered is not an option.
    People should be able to view this record once they visit the website. Whether registered or not.
     
  19. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    In which case, as mentioned elsewhere, you'd need a separate copy of the list/form to use for displaying, with the ACL's configured differently.

    We don't have "view dependent ACLs", which seems to be what you are looking for. Where you can specify the 'read' (details) access differently in form view and details view.

    As with most things where we don't provide a convenient back end setting for, it is technically possible to achieve, in this case by using a form PHP plugin, and running some code on the onElementCanUse and onElementCanView hooks, which lets you make your own access decisions on a per-element / per-view / per-user basis. I can provide some code hints if that's a route you want to go.

    -- hugh
     

Share This Page