1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

Issues with Menu items with Row ID set as -1

Discussion in 'Standard Support' started by aijosh, Jul 9, 2018.

  1. aijosh

    aijosh Member

    Level: Standard
    Hello,

    If I use -1 on a Menu Item so that the owners records load by default this issue occurs.

    When user fills form incorrectly and submit, the form shows the error tip and warnings BUT the elements are rendered as read-only for fields set to be editable by only owner.

    This is an issue since the owner can now not make corrections to the fields and would need to refresh the page and fill the whole form all over again

    Note that, I dont want public to be able to edit these elements but I need them to be able to view the elements.
     
  2. troester

    troester Administrator Staff Member

    Level: Community
    I can't replicate, (failed) validation is working on my site as expected.
    As I said in your other thread
    What are your list access settings, your element access settings?
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I can't replicate this either.

    Are you also using the 'Key Name' ("usekey") setting? You pretty much have to, if you use rowid -1.

    The way that feature works is that rowid -1 sets the rowid for the form being loaded to the logged in user ID. But that almost certainly won't be the primary key of the form. So you also need to tell Fabrik which element you want to use to identify the row to load. Which would usually be a 'user' element.

    The use case for this is where you have a list where each user "owns" a single row. Like a user profile table. By setting rowid=-1 / usekey=your_user_element, you tell Fabrik to load the row for (say) logged on user ID 123 by doing "WHERE your_user_element=123", rather than "WHERE id=X" (where X is whatever the "real" rowid is). If that row exists, Fabrik loads it. If not, we create a new one - and assuming your usekey element is a 'user' element, that will automatically get saved as the logged on user ID, so next time you load the form, it'll find and load it.

    -- hugh
     
  4. aijosh

    aijosh Member

    Level: Standard
    Ok.

    See the following:
    All screenshots in link
    https://www.dropbox.com/sh/mori42ucu4gbe7w/AABVoNq9JaokIND6doucMnB-a?dl=0

    This file shows access level of the elements of this form
    access level - from - element.PNG

    This shows the access level of the list
    access level - education - list.PNG

    I have a separate element for userid same with what was specified on the menu item
    key row.PNG

    See menu item
    Menu - form - education.PNG
    User's record load ok when user visits the form
    Frontend User - Record Loads Correctly.PNG

    If user fills incorrectly, then user cannot edit form again until the url is re-entered. Refresh doesn't work.
    after error - user cannot make correction.PNG
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Can you provide credentials in your My Sites for this site? I've tried setting up a test here with similar ACL's, but just can't replicate what you are seeing. I need to look at the backend and go through your settings.

    -- hugh
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Ah HAH!

    Does your user 'userid' element itself have ACL's on it? On a hunch I tried setting the add/edit ACL on my userid element (to the same as the other elements I'm testing with, so Registered and Super User / 'or user' userid), and with that setup, I get the same issue as you.

    So, if your userid element has ACL's on it, try setting those to Public, see if that helps.

    I'm currently trying to figure out why this happens, I can kinda see, it's a sort of Catch 22 / chicken & egg thing ... I may or may not come up with a fix for it ... but for now a workaround would be to remove the restrictive ACL on the user element.

    -- hugh
     
  7. aijosh

    aijosh Member

    Level: Standard
    Changed all userid elements to public. No luck.
    I have added the admin credentials.

    PS: I notice one of the elements dont have this issue. The detail element remains editable. I checked and the settings are the same with other elements so I'm wondering what is wrong
     
  8. aijosh

    aijosh Member

    Level: Standard
    Hello,
    Any progress on this?
     
  9. aijosh

    aijosh Member

    Level: Standard
    I'm here again with a bump.
    Please revert
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I can really only juggle a certain number of questions from one user at a time. This one is in the queue behind several of your others.

    -- hugh
     
  11. aijosh

    aijosh Member

    Level: Standard
    Hello, a handful of my requests are a week old now and unanswered. Do I need to post a reminder on all of them or just this one is ok.
    Regards,
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Feel free to bump a thread, once it's more than 3 days.

    Which site / form is this on? I still can't replicate the problem here, unless I restrict access to the user element. I obviously need to log in to your site, check your settings, and try and replicate them exactly here.

    -- hugh
     
  13. aijosh

    aijosh Member

    Level: Standard
    Manifesto
     
  14. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I don't seem to be able to get through the htaccess for the backend. I've copied and pasted the credentials you gave us twice.

    -- hugh
     
  15. aijosh

    aijosh Member

    Level: Standard
    Tested it again now and it still works ok.
    Did you check the notes I attached to the site? If no, then you'll find the htaccess credentials there. If yes, please ensure you are not copying and pasting spaces. A lot of times, copying and pasting includes spaces in what was copied.
     
  16. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I am positive I'm copying it correctly. Just tried again.

    Ah, the problem is http vs https. The link you gave us is http, but apparently the htaccess only works for https.

    So I'm in on the backend. I'll find some time today to check your setup and try and replicate the issue locally.

    -- hugh
     
  17. aijosh

    aijosh Member

    Level: Standard
    Ok. Great to hear that. I dont think you would have been able to reach the http site cos I forced https sitewide and also www. (One of the reasons was because I noticed the comments only appear on the exact url they were posted on). I might need to open a forum post for help/advice if I cant get all instances of a form to load using the same url(I see there are lots of ways to reach a form).

    Ok. I just tried using http.

    Apparently, there are two redirects when you visit the http. One to https and the second one to https://www but not before you get the prompt for the folder password. Hence, you'll be asked for the same credential 3x if you use the http link instead of the https://www.

    I'll note this for future link provisions
     
    Last edited: Jul 24, 2018
    cheesegrits likes this.

Share This Page