Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Frank Ralf’s picture

Here's a first stab at a D7 port. I ran the code through Coder an got rid of all issues. The module installs ok, but I haven't done any thorough testing.

There are still some parts where the code should be brushed up. And I still have to figure out how to make this an official release using Git, so for the time being just posting the code here.

Virgil’s picture

Hi,

Thank you for your work. Just to let you know that unfortunately the module creates a second header (I'm afraid is actually a second/double page) on the bottom of a node when you check that particular logged user to have the access ignored. I tried it with the administrator account. And I was able to replicate it with different themes. So, I'm afraid is related to this module.

Frank Ralf’s picture

Thanks for testing and the feedback. Will look into this as soon as I find the time.

Frank Ralf’s picture

Status: Active » Needs review

I cannot reproduce this error. Could you perhaps post an error message and/or a screenshot?

Be sure to have cleared all caches, run cron.php and perhaps also update.php.

Virgil’s picture

FileSize
81.59 KB

Thank you Frank for your answer. I am using D 7.12. I used to have the 6 version of this module but I uninstalled it before migration. And of course, I run update.php and I cleared my caches including forcefully emptying all the cache tables in my database. So, basically I doubt there is any other cache left somewhere.
I am logged using the administrator account and I checked the box in the filter settings for "Ignore administrator". The error comes up only on the /content/ pages. And it is regardless of page.
I'm sending here in attachment a screenshot of the error.
Thank you again for your work and assistance.

Frank Ralf’s picture

Thanks for the screenshot. Please try the attached code. I think I encountered the same error after posting the above code and might have already amended the code.

Virgil’s picture

Hi Frank,

this time the error seems to point to some declaration mismatch:

Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /home/itest/public_html/hermeneia6-7/sites/all/modules/statistics_filter.module on line 73 and defined in db_query() (line 2313 of /home/itest/public_html/hermeneia6-7/includes/database/database.inc).

Frank Ralf’s picture

Thanks for the feedback.

The database query has to be rewritten anyway using db_delete, which might amend this issue.

Virgil’s picture

Thank you for your answer and work in providing this module even before to be released.

Frank Ralf’s picture

Well, I should have read the error message more carefully. There was another query which I hadn't touched yet ...

And I finally managed to reproduce the error message ;-)

The new code should work but the query in question should be rewritten using db_update() which is still on my to-do list.

Virgil’s picture

Thank you but it doesn't work. There is no error anymore but the "administrator" account reads are still counted when a particular node is refreshed. The process I followed is that I uninstalled the previous version of the module, cleared the cache, installed the last one and performed update.php. But the counter is still registering. :(

Frank Ralf’s picture

Please try the functionality with another role whether the module works at all because I have also tried the above mentioned change to using "db_delete" which might not work correctly.

The behavior of the administrator account (FKA "user 1") seems to have changed with D7 so better first test with a "normal" role. I will keep an eye on this issue and also on the strange fact that the module not only outputs an error message but a full node header.

Thanks for your contribution!

Virgil’s picture

Anytime.
Unfortunately it doesn't work with any other role. And I may add that I tried selecting to filter one role or one role + the authenticated user. Neither of these two options brought any results. The counter was raising as it was no filtering. Sorry.

Frank Ralf’s picture

So the the db_delete() might still be buggy. I switched the code back to the original db_query(). Should work, but not tested yet.

Virgil’s picture

I tested it. There is no error but no filtering either. I tested it both with a normal role and the administrator role.

Frank Ralf’s picture

Version: master » 7.x-1.x-dev
Assigned: Unassigned » Frank Ralf

Please use the official dev release for further testing. I changed the database queries and the module does seem to work ok on my test installations.

Tim Jones Toronto’s picture

Thank you Frank!

Tested fine so far. Did quick ApacheBench tests for hundreds/thousands of hits and the figures add up :)

Impact speed wise of this filter module is negligible too.

Cheers!

Frank Ralf’s picture

Thanks for testing! Will clean up the code and make this an official release soon.

Virgil’s picture

I tested the dev release and it works fine.

Frank Ralf’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for testing! Setting this to RTBC and will make it a stable release soon.

Frank Ralf’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Closing this as there's a first stable release out now. Please open a new issue if there's any problems.