GoMexSI / gomexsi-web

Explore Species Interactions in Gulf of Mexico with the GoMexSI webapp
http://gomexsi.tamucc.edu
3 stars 2 forks source link

Statistics Reference, Unique Interactions, Total Interactions show up as zero (0), even through interactions are present #80

Closed jhpoelen closed 11 years ago

jhpoelen commented 11 years ago

Steps to reproduce:

  1. go to GoMexSI website
  2. inspect statistics section on first page.

Expected: A non-empty list of references containing the gomexsi statistics.

Actual: All zeros for statistics. See attached screenshot screen shot 2013-11-11 at 9 21 18 pm .

jhpoelen commented 11 years ago

I checked the GloBI webservice, and this returns non-zero values.

For instance, on Nov 11, 2013 9:30 Pacific Time, http://trophicgraph.com:8080/info?source=http://gomexsi.tamucc.edu returned :

{
  "columns" : [ "number of studies", "number of interactions", "number of distinct source taxa (e.g. predators)", "number of distinct target taxa (e.g. prey)" ],
  "data" : [ [ 49, 69584, 273, 1247 ] ]
}

Please do note that adding distinct predator and district prey is not accurate, because there might be species that are both predator and prey.

reedhewitt commented 11 years ago

Long story short: The statistics were working for non-logged in users, but not for logged in users. Now it works for both.

The long story: AJAX calls made through the WordPress AJAX manager must be specified as either privileged (logged in) or non-privileged (not logged in). I didn't realize that making the AJAX call non-privileged meant that it will NOT work for a logged in user. Now I have an action in the WordPress AJAX manager for both privileged and non-privileged. (I'm writing this explanation so that if we add a similar feature somewhere down the road and encounter the same issue, we'll have a reminder.)

Reed

jhpoelen commented 11 years ago

@reedhewitt thanks for responding so quickly!

jsimons9 commented 11 years ago

Thanks Reed, and it is now working for me!!!

Jim

From: Reed Hewitt [mailto:notifications@github.com] Sent: Tuesday, November 12, 2013 9:18 AM To: jhpoelen/gomexsi Subject: Re: [gomexsi] Statistics Reference, Unique Interactions, Total Interactions show up as zero (0), even through interactions are present (#80)

Long story short: The statistics were working for non-logged in users, but not for logged in users. Now it works for both.

The long story: AJAX calls made through the WordPress AJAX manager must be specified as either privileged (logged in) or non-privileged (not logged in). I didn't realize that making the AJAX call non-privileged meant that it will NOT work for a logged in user. Now I have an action in the WordPress AJAX manager for both privileged and non-privileged. (I'm writing this explanation so that if we add a similar feature somewhere down the road and encounter the same issue, we'll have a reminder.)

Reed

— Reply to this email directly or view it on GitHubhttps://github.com/jhpoelen/gomexsi/issues/80#issuecomment-28301438.