Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
statistics.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
21 Apr 2009 at 19:38 UTC
Updated:
12 May 2009 at 00:50 UTC
Jump to comment: Most recent file
The table {node_counter} is only used and modified by the statistics.module, but it is installed by the node.module. Let's switch the table to statistics.install so it can be uninstalled along with the statistics.module.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 440768-followup-D7.patch | 644 bytes | dave reid |
| #3 | 440768-statistics-node-counter-table-D7.patch | 6.62 KB | dave reid |
| #1 | 440768-statistics-node-counter-table-D7.patch | 7.04 KB | dave reid |
Comments
Comment #1
dave reidHaving this table owned by statistics.module will also allow us to potentially do some cool things with adding a counter API to allow others things to be 'counted' and not just nodes. Anyway, patch ready for review with update functions included.
Comment #2
j.somers commentedCalling update.php fails with the following error message:
I am unable to find this function on the d.o API site, nor in any of the files on the CVS repository and no results on Google.
I have no idea why the patch might have worked on the test server and requested a retest, is it possible update.php is not called when applying a patch?
Comment #3
dave reidWhoops. Yeah, the testing bot doesn't run update functions. *wish it did*
Revised, fixed patch.
Comment #4
j.somers commentedThis one applied fine, update.php ran fine and everything still works OK.
Comment #5
dries commentedNice one. Committed to CVS HEAD. Thanks!
Comment #6
dave reidJust noticed one thing...currently if the user has the statisitics.module disabled, but not uninstalled, the current node_update function will remove the node_counter table since
drupal_get_installed_schema_version('statistics')will return 0. Revised followup patch checks if the schema equals SCHEMA_UNINSTALLED (-1).Comment #7
dries commentedCommitted to CVS HEAD. Thanks for the correction.
Comment #8
Jaza commentedIf this table is now owned by statistics.module, then shouldn't it be renamed to have a 'statistics_' prefix? I.e. rename it to 'statistics_node_counter'.
Comment #9
dave reidJaza, that's the next step I was going to do (but in a separate issue). I've actually been thinking about renaming/abstracting the table so it can be used for more than just nodes. See #103866: Add a general counter API.