I've patched the user_stats.install to add PostgreSQL support. as PostgreSQL doesn't support the INSERT IGNORE syntax I just did a DELETE and then INSERT of the profile fields created for this module.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | user_stats.install.patch | 1.68 KB | jaydub |
| #2 | user_stats-214040.module.patch | 13.59 KB | jaydub |
| user_stats.install.patch | 1.22 KB | jaydub |
Comments
Comment #1
liam mcdermott commentedCommitted. Well I just removed the MySQL specific stuff, believe INSERT IGNORE is non-standard anyway so better to get rid of it. :)
Have you tested this module with PostgreSQL? Would love to be able to say that we support PostgreSQL.
Comment #2
jaydub commentedOk in testing this out on a virgin install I found a couple of other problems that this patch re-roll fixes as well as verifying PostgreSQL support via some query changes.
First off, the module should have a dependency on profile module since it is based on storing data in profiles. Got caught on that one.
Second, I was using the content_types() function call to get the list of node types but that's a CCK function and when tried on a virgin install it failed. So I changed that to use node_get_types() which should still give the same results.
Third, in testing on PostgreSQL I found a couple queries that wouldn't work as is. This patch has been tested on MySQL and PostgreSQL and the new queries are successfully run on both.
One caveat is that this was not tested with the workflow support. I can eyeball real quick that at least one of the queries that uses UNIX_TIMESTAMP() will fail in PostgreSQL as that is not implemented in PostgreSQL at least with that command name.
that is in user_stats_cron() here
I am on holiday tomorrow so I can pick this back up when I return.
Comment #3
liam mcdermott commentedThere's already a dependency (listed in user_stats.info). I found that Drupal doesn't install dependent modules before the one being installed however. So that might be the problem you're seeing. Am not sure how to work around that one to be honest. :/
This patch doesn't seem to be rolled against the latest CVS version, I'll see if I can work it in however. It's so much bad luck I didn't notice that CCK dependency, as I'd just installed CCK on my dev site to have a mess around with it. Trying it on a virgin install is a great idea, was wondering why my production site was having problems.
Anyway, have a great holiday and thanks for all the help! :)
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
jaydub commentedI've updated to the latest user_stats and I see that you reworked the .install a bit. Unfortunately some of the queries are not compatible with PostgreSQL.
See attached patch for reworked version
Comment #6
liam mcdermott commentedI've tested this with PostgreSQL and MySQL. Looks good. Committed.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.