Formify Permission Error On Submission By Guest
Permalink Browser Info Environment
Hello,
There is an error with Formify that is making it unable for us to submit forms that are created within Formify v3.1
We have a form created using Formify, and enabled the "Add" permission to the Guest but, when a person is not logged in he is not able to submit the form and getting the permission error "You do not have access to submit this form."
We have tested multiple ways, and find that this is a Formify Error, and seems to happen in the latest Concrete5 version of 8.4.0. We did compare the files for the Users in 8.4.0 and 8.3.2 and found differences in the CORE file - maybe that is what is causing this issue.
Please provide us with a way to fix this as soon as you can, as it is causing timeline issues with a project we are working on,
Thank you so much, very much appreciated!
There is an error with Formify that is making it unable for us to submit forms that are created within Formify v3.1
We have a form created using Formify, and enabled the "Add" permission to the Guest but, when a person is not logged in he is not able to submit the form and getting the permission error "You do not have access to submit this form."
We have tested multiple ways, and find that this is a Formify Error, and seems to happen in the latest Concrete5 version of 8.4.0. We did compare the files for the Users in 8.4.0 and 8.3.2 and found differences in the CORE file - maybe that is what is causing this issue.
Please provide us with a way to fix this as soon as you can, as it is causing timeline issues with a project we are working on,
Thank you so much, very much appreciated!
Type: | Ticket |
---|---|
Status: | Archived |
Hey Phil,
I am facing the similar issue with the Formify, Can you guide me what level of permissions I need to check for this.
Thank you very much in advance.
I am facing the similar issue with the Formify, Can you guide me what level of permissions I need to check for this.
Thank you very much in advance.
Hi,
Make sure that the form permissions under settings for the formify form are set correctly. On your web host check that your folder permissions are 755.
Best
Phil
Make sure that the form permissions under settings for the formify form are set correctly. On your web host check that your folder permissions are 755.
Best
Phil
Still facing the same issue, Steps to replicate is :
1. Create a form using formify.
2. Make sure the Guest User has permission to ADD entry.
3. Open the incognito window with the URL you have the form on.
4. Try to submit the form. It will give the error that you do not have the permission to submit the form.
I was able to check why it is happening. This is happening because of in the FormifyForm.php you have these lines of code.
And when I go to the constructor of the User controller to check the code I find that the line of code which assigns the users groups which is this line:
is enclosed within an If condition:
The uID is obviously null as the user is not logged in but when I check the hasActiveSession function I see this:
Which seems to be the reason that the userCanAdd function of formify must be getting an empty array of user groups hence it is blocking the user on incognito mode.
Please advise what can be done to resolve this. And apologies for the long reply. :)
1. Create a form using formify.
2. Make sure the Guest User has permission to ADD entry.
3. Open the incognito window with the URL you have the form on.
4. Try to submit the form. It will give the error that you do not have the permission to submit the form.
I was able to check why it is happening. This is happening because of in the FormifyForm.php you have these lines of code.
$u = new User();
foreach($u->uGroups as $gID) { //Loop through the groups if($this->groupCanAdd($gID)) { //If user is part of a group that can add, they can add return true; } }
And when I go to the constructor of the User controller to check the code I find that the line of code which assigns the users groups which is this line:
$this->uGroups = $this->_getUserGroups();
is enclosed within an If condition:
if ($validator->hasActiveSession() || $this->uID)
The uID is obviously null as the user is not logged in but when I check the hasActiveSession function I see this:
public function hasActiveSession() { $cookie = $this->app['cookie']; return $cookie->has($this->config->get('concrete.session.name')); }
Which seems to be the reason that the userCanAdd function of formify must be getting an empty array of user groups hence it is blocking the user on incognito mode.
Please advise what can be done to resolve this. And apologies for the long reply. :)
Hi,
Firstly, I am not the developer. I just happen to do a lot of support here. I cant replicate this issue in my 8.4.0 install so I cannot see this as a formify issue. It is something about your setup. As you did not start this support request I don't have your environment information to see if there is anything obvious.
Please check your personal messages.
Best
Phil
Firstly, I am not the developer. I just happen to do a lot of support here. I cant replicate this issue in my 8.4.0 install so I cannot see this as a formify issue. It is something about your setup. As you did not start this support request I don't have your environment information to see if there is anything obvious.
Please check your personal messages.
Best
Phil
I was having the same issue but I found this on slack and tried it. Worked for me.
Remove the below from the Records.php file
located in - controllers/api/records.php
Remove the below from the Records.php file
located in - controllers/api/records.php
if(!$f->userCanAdd()) { $e = array(); $e['type'] = 'permissions'; $e['message'] = $f->errorPermission; $response['errors'][] = $e; }
Hey tracyb,
Thanks for your reply. Although changing the check for the permission in the module is not the best solution.
I did find another piece working for me which is including these lines of code on start
Thanks for your reply. Although changing the check for the permission in the module is not the best solution.
I did find another piece working for me which is including these lines of code on start
if (session_status() == PHP_SESSION_NONE) { session_start(); }
The above solution did work for me for the development server however I am still facing issues on the live site the only difference from live to dev is live has 7.0 PHP version and the dev has 7.1 PHP version. Trying to find a solution for the same.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
I have just tested formify 3.1 on C5 8.4.0 and have no issues on a test form submission regardless if the user is logged in or not. Do you have the correct permissions set on your folders?
Best
Phil