Closed sammcqueen closed 5 years ago
I’m not able to reproduce this. Can you send in a request from your Craft Support dashboard widget, and reference this issue? Then we will be able to look into it with your site setup & templates.
Not sure what it was but the latest update to the plugin has solved it. 👍
I'm having a similar error. Updating did not help in my case. I get the following error:
{"success":false,"errors":{"authorId":["Author Id cannot be blank."]}}
This only happens when i'm logged out, else it works fine. I did declare a default author and it also passes when I turn of the validation option. I can't seem to find any other similar issues except for this one, but did not want to open a new issue with the same problem.
Can confirm this issue. Seems like the settings pages saves a wrong uid for the entry author, resulting in a null value being submitted in the save controller.
Ok, so the uid from the elements table is used instead of the one from the users table. I was able to fix my issue by changing the database name in line 226 in SaveController.php to (%users -> %elements):
'authorId' => Db::idByUid('{{%elements}}', $sectionSettings->authorUid),
The above resolved my issue as well.
Just tried whilst logged out and the issue persists. The above change to the Save Controller works so have made a pull request.
Can confirm the @sammcqueen fix works.
All credit to @stenvdb!
Can confirm the @sammcqueen fix works.
Just released v2.2.3 with @sammcqueen’s fix. Sorry about that!
Note: I needed to re-save the Guest Entries plugin settings in the CP to get this fix to take.
Indeed a very important caveat, just updating does not fix the issue, it's only fixed after hitting save in the plugin settings page.
I'm getting an author id validation error whenever I try to submit. Console is showing this:
I only have one user and have set this as the default author in the Guest Entries plugin settings. All other validations seem to be working correctly. Disabling validations in the settings does allow new entries. I've tried disabling CSRF protection with no joy.
Also tried adding a hidden
authorId
form input set to1
just to test, but still receive the cannot be blank error.Craft: 3.1.7