SOLVED: Add new record but don't allow edit of certain elements

boyjah

Member
On our form we have some elements that we want registered users to be able to fill in the first time they submit the form but we don't want them to be able to edit those certain elements after initial submission. We thought that setting Access to those elements such that:
Form (add) = Registered
Form (edit) = Super Users

would be sufficient, but it seems that, with this setting, new users are unable to put information into those elements. The only way we can find to enable them to input to these elements is if we set Form (edit) to user group Registered or below, but then of course they are able to edit those fields after the initial submission.

Is there some other setting that we are missing? Or, is there a different way to achieve our goal that is not related to the element access settings?
 
I can't replicate. These settings are working fine.
Are your "new users" really already registered (i.e. Joomla user exists) and logged in when filling the new form?
What is your list access setting for "Add Records"?
 
As I said: The settings should work.

Did you change something in your Joomla groups, Joomla access levels (e.g. your users' group doesn't have "Registered" access level)?
 
Registered access level does exist and is being used and working across many functions of the site. And we are too intimidated by the permissions setting for user groups to ever touch or modify them, so they remain in the state of a standard Joomla install. However, even if I change Form (Add) to Public in the Access tab, it behaves the same way.

What does Fabrik reference to determine whether a form is adding as a new record or editing an existing record? The one I am testing with is indeed a new record with all fields blank and there is no record with the userid in the Fabrik table for this form. But is there perhaps something that is making Fabrik think that this is an edit rather than a adding a new record?

As a test I set Access to one of these fields such that Form (add) = Super Users and Form (Edit) = Registered and I am still able to fill in the field as a new user filling out the form for the first time, so it really seems like the form is not recognizing the difference between an Add and an Edit?
 
Last edited:
there is no record with the userid in the Fabrik table for this form
How are you adding a new record? Are you using a form menu with usekey=userid and recordId= -1?
 
Is there some way to trigger Add/Edit Access other than by usergroup? Some way to refer to the value of a database field that is not usergroup related? Or is this simply an issue with Fabrik functionality that can be fixed in some way?

Also, I have discovered something about a field that is set to Add = Registered and Edit = Superusers (which means that Add is not available to Registered users, as per the initial issue). If that field validation is a Required field (validation = notempty), then upon submission of the form it comes back with the error "Some items have not been properly filled in." AND the user is now able to fill in the field. Perhaps this will be of help if somebody out there is trying to solve this issue.
 
Last edited:
As I said:
The issue is related to the call via usekey/rowid=-1
In this case Fabrik doesn't get the" is-new-record" status" correctly for the element access. I can see where it is done but I can't see an easy fix.

It's ok if you use the standard Add in the list.

Maybe you can do a workaround with edit access and a php validation checking if the element has changed and the original value was empty.
 
What is your exact use case for having usekey/rowid=-1 set. There might be another approach to achieve the same result.
 
What is your exact use case for having usekey/rowid=-1 set. There might be another approach to achieve the same result.

I'm not sure exactly how to answer, but I will try. The form is for a registered user to fill out a profile that will then be visible to other users. There should only be one database entry for this form for each registered user. I found that if I leave the Row id field blank in Menu -> Fabrik Form Options, then if a user wants to edit their profile information later they only get a blank form. It does not fill the edit version of the form with their existing information. Does that answer the question?
 
OH juuser! You are once again my HERO!!!!!

Thinking about your question, I made a new menu item exactly the same as the other one but with Row id blank. Now, if I use that link for registered users completing their profile for the first time, then Add/Edit Access functions as expected. Then, after they have completed their profile, if they want to edit I only show them the link to the form that includes the rowid = -1/usekey = user_id.

AND IT WORKS AS NEEDED!

THANK YOU THANK YOU THANK YOU THANK YOU!!!!!!!

Is there some way to send you a small donation to express our thanks for all of your great assistance?

And how can I change the title of this thread to append "Solved:" to it?
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top