Posted by victoria_b on March 29, 2010 at 11:59pm
6 followers
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | Defaults |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi,
I'm currently using the 6.x-1.x-dev version with Drupal 6.16 and as admin when I delete a user from the Default relationships list the below error pops up.
"recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/user_relationships/user_relationship_defaults/user_relationship_defaults.module on line 194."
Tried a complete wipe of all UR tables and reinstall of the module but still happens. If I remember correctly this didn't happen when using 6.x-1.0-rc3
If doesn't seem a serious error as I can still proceed past it but still a little disconcerting to see it.
Comments
#1
any update on how this was fixed? This is happening to me as well, only when adding a friend (relationship)
Thanks!
Chris
#2
getting the same error when deleting a default friend...
#3
#4
I just:
Set up a default user.
Created 50 users who have a relationshiip with this user.
Deleted the default user.
No error messages on relationship or user pages, think this one must have been fixed along the way.
#5
After going back to the UR admin page I noticed some notices caused by my tests for this, but no fatal error.
Committed a fix to ur defaults hook_user that now deletes the default entry when a user is deleted and should prevent any future issues like the above from occurring.
http://drupalcode.org/project/user_relationships.git/blobdiff/0c49e3f0df...
#6
And here's a version of this for d7.
#7
+++ b/user_relationship_defaults/user_relationship_defaults.module@@ -246,6 +246,20 @@ function user_relationship_defaults_user_update(&$edit, $account) {
+ $defaults = db_query("SELECT uid FROM user_relationship_defaults")->fetchAssoc();
+ if ($default->uid == $account->uid) {
+ db_delete('user_relationship_defaults')
+ ->condition('uid', $default->uid)
+ ->execute();
+ }
That condition makes no sense :) fetchAssoc() returns an array then you're using it as an object.
Just do the db_delete(), if there is something to delete, it will delete and if the condition doesn't match anything, nothing happens...
#8
And an actual tested working version of the patch. Failed mental transition between 6 and 7 :)
#9
I'm not sure why it needs to be so complicated?
Why not simply do it as I did in my patch?
#10
Ahhhh the magic of dbtng I stared at that one for a while trying to figure out what you meant by "just do db_delete()" and fell back to my version after wiping out all my defaults :)
#11
Commited, not sure what the testbot i waiting for.
Giving this one back to you, you might wanna simplify your code...
#12
Simplified version committed to 6.x
#13
Automatically closed -- issue fixed for 2 weeks with no activity.