OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Bug? Viewing article, views increases by 2 not 1

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Bug? Viewing article, views increases by 2 not 1

Postby darwin » Mon Oct 21, 2013 7:22 am

Hi,
I'm trying to output published article number of views. Using code in article.tpl:
Code: Select all
$article->getViews()

After every article page refresh, views number increases by 2 not by 1. Looked in database, table published_articles and column "views" increases by 2 after every article page refresh.
Strange issue. :o Am I missing something?

Using OJS 2.4.2
Mac 10.6.8
MAMP, PHP 5.4.10

Thanks,
Darius
darwin
 
Posts: 10
Joined: Tue Sep 18, 2012 2:05 am

Re: Bug? Viewing article, views increases by 2 not 1

Postby asmecher » Mon Oct 21, 2013 7:59 am

Hi Darius,

What browser are you using?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Bug? Viewing article, views increases by 2 not 1

Postby darwin » Mon Oct 21, 2013 10:11 am

Hi Alec,
I'm using firefox 24
darwin
 
Posts: 10
Joined: Tue Sep 18, 2012 2:05 am

Re: Bug? Viewing article, views increases by 2 not 1

Postby asmecher » Mon Oct 21, 2013 11:16 am

Hi darwin,

Are you using the Timed Views plugin? If it's enabled, and you don't need it, I suggest disabling it; this should prevent the double-counting.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Bug? Viewing article, views increases by 2 not 1

Postby darwin » Mon Oct 21, 2013 12:09 pm

asmecher wrote:Hi darwin,

Are you using the Timed Views plugin? If it's enabled, and you don't need it, I suggest disabling it; this should prevent the double-counting.

Regards,
Alec Smecher
Public Knowledge Project Team


Thanks Alec,
It's worked! Couldn't find where to disable this plugin, so I deleted it in Report plugins page, but it was not enough and had to delete the timedView directory from Generic plugins.

Darius.
darwin
 
Posts: 10
Joined: Tue Sep 18, 2012 2:05 am

Re: Bug? Viewing article, views increases by 2 not 1

Postby asmecher » Mon Oct 21, 2013 12:22 pm

Hi Darius,

Be careful about outright deleting chunks of code. You can disable this from Journal Management > System Plugins > Generic Plugins.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Bug? Viewing article, views increases by 2 not 1

Postby darwin » Mon Oct 21, 2013 11:41 pm

Hi,
I looked carefully, but couldn't find any timed views settings in generic plugins page, even though directory of timed view plugin exits in generic plugins directory. So, for testing purposes in my localhost, deleted it in report plugins and after that timed view plugin directory itself. Another strange issue: link to report plugins disappeared. Page which is linked is accessible, but displays only title (Report plugins) and list of report plugins settings are empty.
Am I missing something?

Thanks, Darius.
darwin
 
Posts: 10
Joined: Tue Sep 18, 2012 2:05 am

Re: Bug? Viewing article, views increases by 2 not 1

Postby asmecher » Tue Oct 22, 2013 8:25 am

Hi Darius,

You may be experiencing a PHP error where that page is truncated; please check your server's error log to see.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests