Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save field using Postgres: unserialize(): Error #77

Closed
BenParizek opened this issue Feb 14, 2019 · 3 comments
Closed

Unable to save field using Postgres: unserialize(): Error #77

BenParizek opened this issue Feb 14, 2019 · 3 comments
Assignees
Labels

Comments

@BenParizek
Copy link
Member

Steps to reproduce

  1. Install Sprout Fields v3.2.2 using a postgres database
  2. Create a new Address Field
  3. Hit save

Screenshot of error:
http://share.barrelstrength.co/dab2878f8a49

@BenParizek
Copy link
Member Author

BenParizek commented Feb 14, 2019

It seems the issue is being caused by the serialized value in the info.config table being truncated at the end. It just abruptly ends, so perhaps this could be a database configuration issue on my end if we're unable to recreate:

a:9:{s:11:"fieldGroups";a:1:{s:36:"6dd3c3d4-258e-4382-8767-ae2cba1565a4";a:1:{s:4:"name";s:6:"Common";}}s:10:"siteGroups";a:1:{s:36:"c4fecbb1-3e84-442e-a3cf-599786f3b810";a:1:{s:4:"name";s:9:"PGSQL Dev";}}s:5:"sites";a:1:{s:36:"a2f32cc3-1e93-41b8-916c-42d06763c791";a:8:{s:7:"baseUrl";s:17:"$DEFAULT_SITE_URL";s:6:"handle";s:7:"default";s:7:"hasUrls";b:1;s:8:"language";s:5:"en-US";s:4:"name";s:9:"PGSQL Dev";s:7:"primary";b:1;s:9:"siteGroup";s:36:"c4fecbb1-3e84-442e-a3cf-599786f3b810";s:9:"sortOrder";i:1;}}s:5:"email";a:3:{s:9:"fromEmail";s:28:"ben@barrelstrengthdesign.com";s:8:"fromName";s:9:"PGSQL Dev";s:13:"transportType";s:37:"craft\mail\transportadapters\Sendmail";}s:6:"system";a:5:{s:7:"edition";s:4:"solo";s:4:"name";s:9:"PGSQL Dev";s:4:"live";b:1;s:13:"schemaVersion";s:6:"3.1.25";s:8:"timeZone";s:19:"America/Los_Angeles";}s:5:"users";a:5:{s:24:"requireEmailVerification";b:1;s:23:"allowPublicRegistration";b:0;s:12:"defaultGroup";N;s:14:"photoVolumeUid";N;s:12:"photoSubpath";s:0:"";}s:12:"dateModified";i:1550113435;s:7:"plugins";a:2:{s:12:"sprout-forms";a:2:{s:8:"settings";a:9:{s:18:"pluginNameOverride";s:0:"";s:22:"templateFolderOverride";s:31:"sproutforms-accessibletemplates";s:23:"enablePayloadForwarding";i:0;s:14:"enableSaveData";i:1;s:26:"enableSaveDataPerFormBasis";i:0;s:17:"saveDataByDefault";i:1;s:35:"enablePerFormTemplateFolderOverride";i:0;s:15:"captchaSettings";a:3:{s:28:"sproutforms-duplicatecaptcha";a:1:{s:7:"enabled";i:1;}s:29:"sproutforms-javascriptcaptcha";a:1:{s:7:"enabled";i:1;}s:27:"sproutforms-honeypotcaptcha";a:3:{s:7:"enabled";i:1;s:17:"honeypotFieldName";s:9:"beesknees";s:27:"honeypotScreenReaderMessage";s:22:"Leave this field blank";}}s:30:"enableEditFormEntryViaFrontEnd";i:0;}s:7:"enabled";b:1;}s:13:"sprout-fields";a:3:{s:7:"edition";s:8:"standard";s:7:"enabled";b:1;s:13:"schemaVersion";s:5:"3.2.0";}}s:6:"fields";a:1:{s:36:"033d6143-81de-497a-be31-ea04f46d4c22";a:10:{s:4:"name";s:13:"Address Field";s:6:"handle";s:12:"addressField";s:12:"instructions";s:0:"";s:10:"searchable";b:1;s:17:"translationMethod";s:4:"none";s:20:"translationKeyFormat";N;s:4:"type";s:42:"barrelstrength\sproutfields\fields\Address";s:8:"settings";a:7:{s:5:"value";N;s:13:"addressHelper";O:53:"barrelstrength\sproutbasefields\helpers\AddressHelper":8:{s:26:"

@pdaleramirez
Copy link
Contributor

I fixed this bug here https://github.com/barrelstrength/craft-sprout-base-fields/commits/bugfix/postgres
The problem is right before saving the address setting to the project config. createFieldConfig here https://github.com/craftcms/cms/blob/develop/src/services/Fields.php#L705
converts class properties to the settings properties then when serializing it postgres unable to convert the class to serialize form. To fix it i just removed it and replace it with service method.

@BenParizek
Copy link
Member Author

Resolved in v3.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants