We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Error, Add-on-development

Error creating pages when using auth plugin.

When logged in as Admin user via an authentication plugin I cannot create pages. The error message is: "Sorry, that page could not be created."

Debug shows the following error:

Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'emailaddress@gmail.com' for column 'pageCreatorID' at row 1
Kevin Jackson

Kevin Jackson 0 points

  • 5 months ago

Kevin Jackson said:

When logged in as Admin user via an authentication plugin I cannot create pages. The error message is: "Sorry, that page could not be created."

Debug shows the following error:

Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'emailaddress@gmail.com' for column 'pageCreatorID' at row 1

Kevin. The value should be an integer “ number” but your submitting an email address as pageCreatorID. You may need to post your code being used when submitting content that is causing this error.

The ID will be an email address as I am using an auth plugin. When updating a region the itemUpdatedBy accepts an email address when usingan auth plugin. Should it not be the same when creating a page?

I can replicate the issue using the auth plugin stub listed on https://docs.grabaperch.com/api/auth/.

It may be a bug/change in the core code. All I know is the database query is expecting an integer and because the ID submitted is not an integer an error is being thrown.

We will just have to wait and see what Drew responds on this, cause I am really not sure how to advise from here.

Sorry :(

Robert

Thanks for your help. When authenticated with an external auth plugin most of the other actions such as editing regions, adding collection items etc use the email address is as the identifier that is eneted into the databse in place of the Perch user ID.

I'm not sure how widely the auth plugin functionality has been used so I hope it is just something that has been missed.

Kevin

Drew McLellan

Drew McLellan 2637 points
Perch Support

That's a bug - it's been fixed internally so it should be ready for the next release.

I'm not sure how widely the auth plugin functionality has been used so I hope it is just something that has been missed.

It's basically not used very much.

Drew

Many thanks, I have a firm request from a client so I'll push on and await the fix being released.

For info I have working proof-of-concept integrations with G-Suite and JumpCloud but the client request is for SAML using Azure AD as the identity provider.

Kevin

Drew McLellan

Drew McLellan 2637 points
Perch Support

In the interim, feel free to update the column to char.

Drew

Many thanks, I can confirm the work-around is working.

Kevin