@peregrine said:
so there is discussion id there.
no lets see if the json_decode works.
can you change in that routine to this now:
I made a mistake and the above is now edited.
20 May 2014 - 07:41:24: [Garden] /usr/www/users/stilld/testo.stilldragon.org/applications/vanilla/settings/class.hooks.php, 495, Object.Method(), Resolved Args non jsondecode is {\"DiscussionID\":\"547\",\"DiscussionStub\":\"50l-bain-marie\",\"Page\":\"\"}
and mine
20 May 2014 - 07:33:16: [Garden] /var/www/vanilla/applications/vanilla/settings/class.hooks.php, 499, Object.Method(), Resolved Args non jsondecode is {"DiscussionID":"35","DiscussionStub":"tewt","Page":""}
perhaps we could preg_replace all the \ with nothing.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
magic_quotes_gpc was enabled, I just switched it off and ViewCount is incrementing again!
I just checked, it was off on the old server as well, but on by default on the new server.
Just checked on more info about magic_quotes_gpc, it's also considered to be best practice to have in enabled due to security reasons. I guess I have to leave it switched off then if Vanilla needs it.
Sorry to necro this, but it seems like the most appropriate place since the more recent posts say to search for this one. The plugin URL above is broken and I'm having the same problem described after just upgrading my site via a tool call softalicious. I have attempted to insert some debugging into the code to find out why addview isn't being called and I am not having any luck.
Comments
I made a mistake and the above is now edited.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Done & done.
then the next step if discussion id does not print out
e.g.
20 May 2014 - 07:33:16: [Garden] /var/www/vanilla/applications/vanilla/settings/class.hooks.php, 519, Object.Method(), DISCUSSION id is 35
can you look at these lines is the LogMessage at the bottom. (in the code you added)
or it is like this
the top one is how we want it.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Perhaps the json_decode is an issue.
or perhaps the
yours with \ before the "
perhaps we could preg_replace all the \ with nothing.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Log message is at the bottom:
No idea how it's possible that we get different results on what's shown in the log.
do you have magic quotes turned on. if so can you turn them off
http://php.net/manual/en/security.magicquotes.disabling.php
It would be interesting to see if things work with magic quotes off.
in php.ini
magic_quotes_gpc = Off
or via .htaccess
php_flag magic_quotes_gpc Off
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
DANG! You solved the mystery!
magic_quotes_gpc
was enabled, I just switched it off and ViewCount is incrementing again!I just checked, it was off on the old server as well, but on by default on the new server.
Just checked on more info about
magic_quotes_gpc
, it's also considered to be best practice to have in enabled due to security reasons. I guess I have to leave it switched off then if Vanilla needs it.thanks for your patience. and for the help in helping me test it.
you can put the originals back obviously.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Well done, @peregrine, you are a true master of diagnoses.
I just disabled your IncrementView plugin on our production forum, switched Vanilla Statistics back on, and ViewCount is working as expected again.
@MasterOne
well, you are easy to work with, you don't give up, you respond quicky, and do things accurately.
all necessary make it possible to help the helper solve thing effectively.
at least it is solved for one person
110 comments later all entities included.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
So... I'm having the same issue but this seems like a really involved fix... Damn
Weirdly enough the views still increase in the stats though...
simple question - do you have
do you have magic quotes turned on. if so can you turn them off
http://php.net/manual/en/security.magicquotes.disabling.php
in php.ini
magic_quotes_gpc = Off
or via .htaccess
php_flag magic_quotes_gpc Off
If that doesn't solve you problem, if not it may be another issue. - perhaps caching.
you might also change
in applications/vanilla/models/class.discussionmodel.php in the AddView function.
to
and
in /librarycore/class.statistics.php in the AddView function.
replace this
if (C('Garden.Analytics.Views.Denormalize', FALSE) && Gdn::Cache()->ActiveEnabled()) {
with this
also in your config.php
remove the line totally.
$Configuration['Vanilla']['Views']['Denormalize']
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@mnerurkar
it would be interesting to find out if the above solves your problem for reference sake.
but you can always use the incrementview plugin.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Disabled magic quotes via htaccess. That did the trick. Thanks a lot
When I disable magic quotes via htaccess, I get an Internal Server Error (500).
I'm running Vanilla 2.1.3 on a 1and1 shared host.
some hosts won't alllow certain changes in .htaccess. call your host and ask them for help or perhaps you can change php.ini.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Sorry to necro this, but it seems like the most appropriate place since the more recent posts say to search for this one. The plugin URL above is broken and I'm having the same problem described after just upgrading my site via a tool call softalicious. I have attempted to insert some debugging into the code to find out why addview isn't being called and I am not having any luck.
added
to .htaccess - no luck
edit: had to remove <>s so the tags could be displayed.
Create a file on your server with the following content:
Open that file and check if magic quotes are really off
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.add_x_header Off Off