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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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: 8472
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: 8472
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: 8472
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: 8472
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests