I am trying to:
Allow logged in users from a specific Role to add content to the site (a custom post type created using Toolset) via a form I've created via Toolset.
I expected to see:
The data is submitted and the post is created and attributed to the logged in user.
Instead, I got:
The add form shows up and when it is filled in the post is created, however the author isn't being set as the logged-in user. It is, instead, blank. *Edited to add* Also after submitting I am logged out from the site for some reason?
Hi, that's unusual, I'll be glad to help figure this out.
- Please resave your site permalinks and flush all caches like SG.
- Temporarily deactivate all plugins except Types, Views, Forms and Access, and activate a default theme like Twenty Nineteen. If you want to keep the Maintenance Mode plugin active during testing, that's fine.
- Test again.
- If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem is not resolved, I'll take a closer look. Please provide the login credentials for one of these Users. Private reply fields are available here for your communication.
- Please also let me know the URL where I can find the Form you are describing. I'll take a look and give you some feedback.
Thanks for this, I've done as you suggested and it looks to me like the issue is with the "Coming Soon & Maintenance" plugin which we are using to lock the site prior to its launch as I deactivated then reactivated all plugins and my current theme and it was only when that was reactivated that it came up with the error.
The plugin is there just to keep the site behind a holding page but to allow that to be bypassed with the usage of a passkey added into the URL, after which you can browse the site as normal.
Not quite sure why there is a conflict but to work around it for now I'll just have to deactivate the plugin whilst I'm testing features such as that. Do you have any ideas as to why this might be happening?
I'm not quite certain offhand, but maybe it has something to do with the URL of the redirect? When one of these Users submits the Form, what is the full URL of their redirect destination? And when you say the User is logged out of the site, how are you aware of that, specifically?
Hi there - just to say it looks like I've managed to resolve this without needing to completely disable the CMP plugin.
FYI, the URL after submitting the form was the same both when the plugin was enabled and disabled (something akin to hidden link) and I knew I was logged out because I had a menu item which was set to only display to non-logged in users and after submission it was back - also when I went to the "my listings" page nothing was shown since I was no longer logged in.
I resolved by making use of the setting within CMP for "Bypass by User Roles" and added my two custom Roles into this. Interestingly the submitted post *was* added but the author field was blank - so it looks to me like the CMP plugin was, for some reason, logging the user out (perhaps a new session being created?) during the form submission process. Strange but working now!
Interesting, I wasn't aware of this setting in CMP but good to know for future reference! Feel free to reopen here if you experience more issues with this Form.