Hi everyone, I have a problem when I enable User Relationship in my drupal site, the confirmation page show me the next error:
PDOException: SQLSTATE[HY000]: General error: 1 table "user_relationships" has more than one primary key: CREATE TABLE {user_relationships} ( rid INTEGER PRIMARY KEY AUTOINCREMENT, requester_id INTEGER NOT NULL CHECK (requester_id>= 0) DEFAULT 0, requestee_id INTEGER NOT NULL CHECK (requestee_id>= 0) DEFAULT 0, rtid INTEGER NOT NULL CHECK (rtid>= 0) DEFAULT 0, approved INTEGER NOT NULL CHECK (approved>= 0) DEFAULT 0, created_at INTEGER NOT NULL CHECK (created_at>= 0) DEFAULT 0, updated_at INTEGER NOT NULL CHECK (updated_at>= 0) DEFAULT 0, flags INTEGER NOT NULL CHECK (flags>= 0) DEFAULT 0, PRIMARY KEY (requester_id, requestee_id, rtid) ); ; Array ( ) in db_create_table() (line 2588 of C:\xampp\htdocs\drunk\includes\database\database.inc).
The site is unusable when this error appears.
Can anyone help me?
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | error_d2.png | 55.88 KB | grinfuses |
| #7 | git_error.png | 12.61 KB | grinfuses |
| #5 | user_relationships_install.txt | 4.92 KB | grinfuses |
| #5 | user_relationships_module.txt | 33.45 KB | grinfuses |
| #4 | fix_sqlite_compatibility.patch | 5.16 KB | berdir |
Comments
Comment #1
berdirStrange, are you using an SQLite database?
Comment #2
berdirAh I think i know what the problem is.
rid is serial but the primary key is on different columns. This seems to work for MySQL/PostgreSQL but results in errors in Sqlite.
Patch will follow in a few hours.
Comment #3
grinfuses commentedThanks!
Comment #4
berdirPlease try the attached patch. That should at least get you beyound the installation. Wasn't trivial to fix but the code makes more sense now.
Note that you are the first person ever to use this module with an SQLite backend so it is very possible that there will be more issues. Please continue to report anything you can find!
Comment #5
grinfuses commentedHi, the patch don't work, when I patch in the code, don't show me the error because don't enable the module.
I attach the .MODULE and .INSTALL , so you can see.
I'm glad to be the first person who report issues to this great module.
Comment #6
berdirYour patched file looks wrong.
Do not apply patches manually, there are many tools that can do that automatically. You'll have learn once how to do it but starting from then, it will save you many hours of tedious work and will allow you to quickly test patches for contributes modules.
See http://drupal.org/node/1010894 for how to install Git (on windows and other plattforms), http://drupal.org/patch/apply for how to apply patches with Git and there is also information about various GUI tools that you could use. Especially Eclipse/EGit there seems to be documented very well but it will take a bit of time to install it.
Also, you can apply patches if you don't have console access to your webserver. Just download the whole module directory, apply the patch locally and then re-upload the changed files.
Comment #7
grinfuses commentedI apply patches with Git and appears this message
Comment #8
berdirPatches are always against the most recent -dev version, you have to update to that first. Otherwise, I wouldn't be able to commit them afterwards.
Comment #9
grinfuses commentedI use the patch with Git and dev version and I can enable the module, but when I configure the permissions for the users, the module show me this error.
PDOException: SQLSTATE[HY000]: General error: 1 no such table: user_relationship_types: SELECT * FROM {user_relationship_types}; Array ( ) in user_relationships_types_load() (line 363 of C:\xampp\htdocs\drunk\sites\all\modules\user_relationships\user_relationships.module).
I think that is a new issue, but less than last.
I attach the picture of this error.
Comment #10
berdirAh yes, that is probably because the installation failed the first time you tried, so it's currently in a inconsistent state.
Try to actually uninstall all user relationship modules in the Uninstall local task below modules and then try to install again.
Comment #11
grinfuses commentedI tried to use with a new drupal site and patching with git and i can`t patch because git says me that corrupt patch at line 25.
I don't know if i'm so useless patching modules or the patch is really corrupt at line 25.
Sorry.
Comment #12
berdirHow did you apply the patch?
This works fine for me, just tested:
What is the exact error you get? Are you using the most recent 7.x-1.x version of User Relationships?
Comment #13
grinfuses commentedI use the code and git patch me correctly.
I change the status to closed.
I continue using the module, if i have another issue, i post it!
Comment #14
berdirWhen you've reviewed something, set it to "reviewed & tested by the community" (RTBC).
Then, I'll commit it and set it to fixed. After two weeks of no activity, it will automatically be set to closed (fixed).
For more information about that, click on the Status and Issue queue handbook links.
--
Thanks for testing!
Comment #15
berdirThanks for reporting, reviewing, and testing! Committed.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Powered by Dreditor (triage sandbox) and Triage transitions