Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting the warning below when viewing a user's profile page. I don't see SQL commands anywhere in the install file to create that particular table, so I'm wondering if it's missing. If you could post the CREATE command for this table I can add it to my database and see if the warning clears.
* user warning: Table 'drupal5.privatemsg_block_user' doesn't exist query: select count(*) from privatemsg_block_user where author = 0 and recipient = 1 in /var/srv/www/includes/database.mysql.inc on line 172.
* user warning: Table 'drupal5.privatemsg_block_user' doesn't exist query: select count(*) from privatemsg_block_user where author = 0 and recipient = 1 in /var/srv/www/includes/database.mysql.inc on line 172.
Comment | File | Size | Author |
---|---|---|---|
#18 | privatemsg.install.070825.patch.txt | 5.51 KB | salvis |
#16 | report_2007-08-24.pdf | 114.67 KB | olio |
#15 | privatemsg.install.070823b.patch.txt | 5.24 KB | salvis |
#14 | test_2007-08-23.pdf | 178.6 KB | olio |
#13 | privatemsg.install.070823.patch.txt | 5.35 KB | salvis |
Comments
Comment #1
toma CreditAttribution: toma commentedi have the same issue
Comment #2
ggray CreditAttribution: ggray commentedI have the same with latest build (17-Aug)
Comment #3
salvischx added it three days ago.
Comment #4
dziemecki CreditAttribution: dziemecki commentedI *just* downloaded it and get this error.
Comment #5
olio CreditAttribution: olio commentedThe install file needs to be updated: The table 'privatemsg_block_user' won't get updated but only be installed for user doing a fresh installation. So, everybody who is already using privatemsg will run into the same problem.
I still don't know much about creating patches and CVS, so please excuse me posting the fix here. Anyway, for those needing to fix the bug immediately, run following query in MySQL (worked for me):
As far as I understand, following entry should be appended to the next update of the privatemsg.install file :
Comment #6
olio CreditAttribution: olio commentedOops, sorry for the typo in my last post: The Query for MySQL has to be as follows:
Comment #7
salvisYou're right, updating doesn't add the table. If you apply this patch, you'll get another chance to update, and this one will add the privatemsg_block_user table.
Let us know whether it works.
@chx: I'm confused about the pgsql version of privatemsg_update_3():
Comment #8
salvisIt turns out there's a lot more work to be done...
Fix http://drupal.org/node/163908 [')' instead of '('].
Here's a list of the recent updates:
All these changes were done without providing an update() function.
The attached patch replaces #7. It fixes all these inconsistencies and provides an update() function to make the necessary changes to the database.
@chx: varchar(255) seems to be more popular than varchar(256), so I chose the former. Should privatemsg_archive.subject also be changed to varchar(255)?
Comment #9
olio CreditAttribution: olio commentedHi,
I tried the patch twice, but received a bundle of error messages (see attached screenshot). Both times with the same errors.
First time, I deleted the table privatemsg_block by hand and updated after patching the install file.
Next time, I deleted all tables and entries in the system table, then installed a fresh version of privatmsg 1.8. Afterwards, I installed the patched 2.0 version.
Please let me know if I should try/ test something else.
Comment #10
salvisThank you for your test and report. Please try this slightly modified patch instead.
With this new patch you should be able to upgrade successfully from your current state (after producing the error messages that you sent, with or without deleting the privatemsg_block_user table), IF you set the schema_version for privatemsg back to 3 in the system table, so that Drupal will run the privatemsg_update_4() function.
You should also be able to upgrade cleanly from 1.8 now, and I'd appreciate it, if you could give this a try as well.
BTW, uninstalling Privatemsg (after disabling it) should give you the same (or even better) result as manually deleting the tables and records from the system table.
Is anyone out there using PostgreSQL? It would help me tremendously if you could try out this patch and report back.
Comment #11
salvisOops, seems like I always need two uploads. Forgot to remove the carriage return characters...
Comment #12
olio CreditAttribution: olio commentedHi Salvis,
thank you for the hint with the uninstall feature - I really must be blind to ignore the uninstall button on the module page...
I tested both ways you asked me to do with following results (pictures say more than words, therefore I made some screenshots again):
- After setting back schema to 3, the update 4 ran succesfully (p. 1).
- Now I tested the new (for me ;o) ) uninstall feature. The privatemsg and variable tables were cleaned, only the system table entry was still there after uninstall. (p. 2).
- I cleaned it manually and installed version 1.8, then I updated to v.2.0 with the patched install file: The database update screen offered me update 3 (p. 3) and all updates were successful (also update 4, see p. 4).
- Now, I activated the mail_edit module and got a warning (p. 5) due to a missing uninstall function in the install file. I deleted this existant table and hit "Save Configuration" again. The installation now ran without problems and the table was created.
- Everything looked fine, except one small thing: The privatemsg module threw a warning that the column 'type' in the privatemsg table is missing (p. 6).
Thanks for your support.
Comment #13
salvisHi olio,
Thanks again for the detailed report. I'll open a different issue for mail_edit and focus on Privatemsg here.
chx has updated privatemsg.install to 1.5.2.4.2.7 three hours ago (5.x-2.x-dev will be updated by the packaging script within a few hours, or you can take the file from CVS).
I rerolled the patch for 1.5.2.4.2.7 and added the missing privatemsg.type column, and I've also fixed $db_prefix support. I hope this will be the last iteration... Would you take another stab at it, olio?
Is there anyone using PostgreSQL?
Comment #14
olio CreditAttribution: olio commentedHi Salvis,
I tried the patch and called the db-update page, where an syntax error message appeared (p. 1: "Parse error: syntax error, unexpected '{'... "). The error disappeared after I added a missing closing bracket ')' to each instance of '(db_prefix_tables(...' in the install file (p. 2).
By the way, I'm not sure, but as far as I understood, there's no need to add curly brackets because the function function db_prefix_tables() adds them automatically (http://api.drupal.org/?q=api/function/db_prefix_tables/5). After deleting those and adding the missing closing brackets, I could update without errors.
O.k., now everything seemed to be fine: No errors while calling the pages list, compose, contacts, manage folders.
Until I composed and sended a private message - where drupal showed me a white screen (and the URL was still 'privatemsg/new', see p. 3)! But the message was correctly sent and received (p. 4 and 5) and also there was no log entry (p. 6).
Comment #15
salvisHi olio,
It turns out that db_table_exists() does it all by itself, without the db_prefix_tables() nor the curly braces. It was a long ride, thank you for pulling through!
I'm sure there are still a few bugs in privatemsg.module. Please open up a new issue regarding the white screen — chx will have to take care of that. My goal here is to fix the database issues, so that we can at least install Subscriptions and Privatemsg. chx has an assignment to develop new features for both modules, and he's working on a very tight schedule. He assured me that he'd be switching to bug fix mode RSN, and if we can already get rid of the database issues now, he'll be able to concentrate on actual bugs.
Would you also try the http://drupal.org/node/169703 patch for mail_edit?
Thanks again!
Comment #16
olio CreditAttribution: olio commentedHi Salvis,
o.k., I will open up an issue for the white screen problem.
I began with a fresh install of the patched version and got some warnings.
warning p. 1:
- On line 158 (after patching), I think the table name should be changed to 'privatemsg_mail_edit' instead of 'mail_edit'.
warning p. 2:
- On line 49, an entry 'description varchar(255) NOT NULL' made the user warning disappear.
warning p. 3:
After this warning I uninstalled privatmsg again and installed an unpatched version 2.0.
The same warning (p. 1) appeared again. So I decided to change line 158 in order to continue with testing your patch:
- On line 158, I combined the two 'db_query("INSERT INTO {privatemsg_mail_edit}...' into one. Although I'm not sure if this has other side effects, the warnings disappeared and I could use privatemsg normally (that means up to the white screen I described yesterday).
Now I applied the patch and ran update afterwards:
warning p.4:
Duplicate entry for column name 'type'.
Beside this, the patch worked well and I could use privatemsg.
I will continue now with the test of your mail_edit patch.
Comment #17
salvisHi olio
I'm sorry about the delay.
No, I don't think so. The mail_edit table belongs to mail_edit, and the privatemsg_mail_edit table belongs to privatemsg. The two INSERTs were added by chx.
You need to install mail_edit before privatemsg, then the p.1 message should go away.
Your other tests are not valid because of your change.
I thought I'd wait for chx to post an updated .info file to advertise the prerequisites, but I'm breaking down and will post a patch...
Comment #18
salvisIt just dawned on me that the two INSERTs, which chx recently added to privatemsg_install(), also need to go into privatemsg_update_4().
So, here's my last iteration.
P.S. I'll add the .info patch (to enforce the depencencies on mail_edit and Subscriptions) to http://drupal.org/node/168470 shortly. Apply that patch before enabling Privatemsg to see it in action.
Comment #19
chx CreditAttribution: chx commentedComment #20
(not verified) CreditAttribution: commented