Getting error PDOException when trying to create new user at user/register. Admin can add users at admin/people/create.
Using Logintoboggan module, Added and removed a number of fields from user account, included then removed "use profile2 on registration".
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_published_value' at row 1: INSERT INTO {field_data_field_published} (entity_type, entity_id, revision_id, bundle, delta, language, field_published_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => message [:db_insert_placeholder_1] => 1167 [:db_insert_placeholder_2] => 1167 [:db_insert_placeholder_3] => example_user_register [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 448 of /home1/reallig1/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedAlso enabled then disabled:
PERSONALIZATION
Enable signatures.
Enable user pictures.
Enable pictures on registration
Comment #2
Alan D. CreditAttribution: Alan D. commentedI believe that this error should be lodged against the module that provides the "message" entity type. My best guess is the message module, but switch queues if I'm mistaken.
Let the maintainer know what integration this has with the user profile and also if you have Rules firing off actions during registration
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks. There was one Rule to redirect on login to user/ but I deleted the rule earlier as part of my troubleshooting.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedUpdated Message module version installed.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedRemoved Message Module and can now register as a new user at user/register.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedInstalled 7x-1.x-dev and received following WSOD level error after attempting to clear cache & run cron:
Warning: array_keys() [function.array-keys]: The first argument should be an array in drupal_schema_fields_sql() (line 6899 of /home1/reallig1/public_html/includes/common.inc).
Warning: array_keys() [function.array-keys]: The first argument should be an array in drupal_schema_fields_sql() (line 6899 of /home1/reallig1/public_html/includes/common.inc).
Warning: array_keys() [function.array-keys]: The first argument should be an array in drupal_schema_fields_sql() (line 6899 of /home1/reallig1/public_html/includes/common.inc).
Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /home1/reallig1/public_html/includes/entity.inc on line 284 and defined in SelectQuery->fields() (line 1300 of /home1/reallig1/public_html/includes/database/select.inc).
Removing Message module results in recovery of site and normal operations.
Comment #7
amitaibuI'll need more info. Can you reproduce on a clean installation?
Comment #8
gilzero CreditAttribution: gilzero commented+1 I also have the issue. With Message module installed, I tried to use Services api to register an user. Got the error.
After I disabled Message module, register an user via Services works.
Comment #9
fiockthis CreditAttribution: fiockthis commentedI'm receiving the same error with the Message module enabled.
Comment #10
mskill99 CreditAttribution: mskill99 commentedRecently installed Message on site for first time. Used 7.x-1.7. Immediately encountered this error. Came here, read thread, disabled module. Error went away, new users successfully register on site. Here is my error message:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_published_value' at row 1: INSERT INTO {field_data_field_published} (entity_type, entity_id, revision_id, bundle, delta, language, field_published_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => message [:db_insert_placeholder_1] => 8 [:db_insert_placeholder_2] => 8 [:db_insert_placeholder_3] => example_user_register [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 448 of C:\Users\Mskil\Sites\dev01\modules\field\modules\field_sql_storage\field_sql_storage.module).
Comment #11
amitaibuMaybe you have message-example installed, but didn't clear-cache?
Comment #12
stupiddingo CreditAttribution: stupiddingo commentedIt appears that if "Who can register accounts?" under Account Settings is set to "Visitors, but administrator approval is required" then $account->status returns null rather than 0.
If set to visitors $account->status correctly returns 1.
Adding this modification to message_example_user_insert() in message_example.module seems to fix:
Comment #13
amitaibuOk, how about writing a proper patch ? :)
btw, you should probably disable message_example in production -- it's just an example module.
Comment #14
stupiddingo CreditAttribution: stupiddingo commentedPatch it is then. ;)
Looks like we can simply test that there is a status and if not use the unpublished default simplifying the patch a bit.
Comment #15
amitaibuinstead of "integer", maybe better write "status" property doesn't exist.
Use !empty()
Comment #16
stupiddingo CreditAttribution: stupiddingo commentedAmitaibu, I really appreciate you taking the time to guide me through what I am sure you could much more quickly just do on your own. Thanks for guiding me down the road toward providing patches, your patience and mentorship are emblematic of why I've fallen in love with Drupal and the Drupal Community. And thanks for all your contributions, I build web using your modules every day!
Comment #17
stupiddingo CreditAttribution: stupiddingo commentedHere's a different version of patch 16 that also changes the published field for user registration messages on hook_user_update().
Use cases would involve installations where the account setting is "Visitors, but administrator approval required" and an administrator approves a new registration or a user is blocked.
I bundled the update logic inside hook_user_update() rather than cruft up message_example_update_message_status(). Not certain if this was the right decision. Or for that matter I'm not certain if this should be a separate issue ;)
There may be some unnecessary recursion in here. I wasn't sure what cardinality was possible given the complexity of different Drupal installations.
Comment #18
amitaibu> I really appreciate you taking the time to guide me through what I am sure you could much more quickly just do on your own.
Sure, as long you provide the patches/ docs I'll do what I can :)
I prefer not to deal with #17 -- remember, this is just an example module, so I don't care about all the use cases. So review for #16. Minor issues:
You have trailing space.
Missing dot in end of line.
Comment #19
amitaibuBetter title
Comment #20
stupiddingo CreditAttribution: stupiddingo commentedBetter late than never?! (#16 corrected)
Comment #21
quiethero CreditAttribution: quiethero commentedCannot create New User Account
Initially I got this error: EntityMetadataWrapperException: Unknown data property field_published. in EntityStructureWrapper->getPropertyInfo() (line 339 of /home/mysite/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).
I don't have access to GIT and I have exhausted trying to use the Drupal Patch module: http://drupal.org/files/message-error-when-trying-to-create-new-user-180.... Ran the Patch and
Got this error: EntityMetadataWrapperException: Unknown data property field_node_ref. in EntityStructureWrapper->getPropertyInfo() (line 339 of /home/mysite/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).
I have even tried to put the patch into the message_example directory. Nothing.
Any suggestions?
Comment #22
stupiddingo CreditAttribution: stupiddingo commentedIt would be best to use git, but it isn't necessary. Just encouraged. ;)
You can use git on your local machine and then copy the files up to the server. There are git clients for every OS. Here's a basic overview of how to patch with a good video that helped me.
A patch file is a set of instructions to edit other files. This particular patch is editing four lines in message_example.module (most likely located at /sites/all/modules/message/message_example/message_example.module in your installation).
If you open message-error-when-trying-to-create-new-user-1807532-20.patch you'll see it pretty readable.
Until you become familiar with git you can simply open a text editor and add the lines prefaced with a + (plus) and delete those with a - (minus). This method may kill kittens, but it works and it will familiarize you with git syntax and drupal coding. At least that's how I started. ;)
In the case of this patch though, that isn't even necessary. If you go to http://{yoursite}/admin/config/people/accounts and set "Who can register accounts?" to anything but "Visitors, but administrator approval is required" you won't see this error.
Also, as Amitaibu advised above... you don't want to be running an example module in production, so changing this setting shouldn't be an issue in testing/development.
Comment #23
quiethero CreditAttribution: quiethero commentedA hopeful as I was that this was the solution and after trying every combination of "Who can register" they all returned the same exact error.
EntityMetadataWrapperException: Unknown data property field_published. in EntityStructureWrapper->getPropertyInfo() (line 339 of /home/mysite/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).
Then, I manually tried to patch the file and the following:
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
Once it has been approved, you will receive an e-mail containing further instructions.
Thank you very much!!!
Comment #24
amitaibuIt's not critical if it's in the example module..
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedChanging title to reflect current understanding. I enabled all message modules today (including example) and immediately reproduced the error.
I updated to the latest dev version, same error.
My site no longer requires approval of new members.
Comment #26
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented