Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Showing group register field on registration page get this error:
Recoverable fatal error: Method DatabaseCondition::__toString() must return a string value en og_register_query_og_alter() (line 51 de /var/www/d7/sites/all/modules/og/og_register/og_register.module).
OG field settings:
- Group - Node entity : Group & Group register
- User - User entity : Groups audience
also showing groups audience field (account settings) in registration form
Comment | File | Size | Author |
---|---|---|---|
#17 | 1782768-og-register-query-fix-17.patch | 636 bytes | amitaibu |
#14 | og-error-sql.zip | 350.11 KB | MXT |
#5 | og-condition_field_is_string-1782768-5.patch | 508 bytes | evgeniysolodkov |
#1 | og-1782768-1.patch | 437 bytes | evgeniysolodkov |
Comments
Comment #1
evgeniysolodkov CreditAttribution: evgeniysolodkov commentedI had the same issue and wrote a little patch to solve it. You're welcome to try it.
Comment #2
amitaibuComment #4
amitaibuCan you re-roll patch, so it can be applied by testbot?
Comment #5
evgeniysolodkov CreditAttribution: evgeniysolodkov commentedRe-roll of #1... making my first patch, sorry if i'm doing something wrong ))
Comment #6
qproI applied the patch to 7.x-2.0-beta2+32-dev version and now get this:
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] => 75 [:db_insert_placeholder_2] => 75 [:db_insert_placeholder_3] => example_user_register [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) en field_sql_storage_field_storage_write() (line 448 of /var/www/d7/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #7
mpotter CreditAttribution: mpotter commentedJust patching it to skip if you can't convert to a string isn't the solution. If you actually dump the $query object (or the $condition object), you'll see that there is a recursive Condition element attached to the query somehow. We need to figure out where the botched query is getting created in the first place and fix it there. Still debugging this. Pretty much makes the og_register module useless right now, so also raising the importance.
Comment #8
mpotter CreditAttribution: mpotter commentedLooks like this is a complex query where there is a nested "SELECT" statement within the Condition of the main query. It is happening for taxonomy entity types ($group_type = 'taxonomy_term') and the nested Select looks like some complex access check. Not sure why it's even calling this with taxonomy_term.tid. At one point I tried to set up a taxonomy as a group, but I deleted that. But maybe there is something still stuck in one of the database tables that would make this harder to reproduce.
Thing is, even if I "return" from this alter function if $entity_type != 'node' I still don't see a list of my group on the new user register page.
Comment #9
MXTI have the same issue: any news on this?
Thank you very much
Comment #10
amitaibu@MXT , are you using latest dev?
Comment #11
MXTHi Amitaibu, I'm using 7.x-2.0-beta4 (dec 13).
Let me upgrade to latest dev (dec 18), then I'll come here to refer.
Comment #12
MXTYes, I can confirm that the error persist also with latest dev (dec 18):
Some info:
Thank you for paying attention to this issue
Comment #13
amitaibuCan you attach a db dump, with all unrelated modules disabled?
Comment #14
MXTHere in attachment a fresh installation with only OG module (and related) installed.
With this attached DB you can verify by yourself:
Superuser credentials:
Installed modules:
Thank you very much for working on this
Comment #15
amitaibu@MXT,
In what link do you see the error?
Comment #16
amitaibuOk, I see - in user register. Changed title
Comment #17
amitaibuComment #18
amitaibuCommitted.
Comment #19
MXTThank you very much for resolving the issue Amitabu, now the error disappears, but now there is another issue:
If a user choose a group on the website registration form then, after form submission, user is immediately added to that group even if that group needs a membership approval.
User state is automatically set to "active" instead of "pending" bypassing the subscription request and approval from group administrator (obviously if the permission "Subscribe to group" setting for that group is setted to
"Allow non-members to request membership to a group (approval required)".
I'll open another issue for this.
EDIT: here's the link: http://drupal.org/node/1873194