The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
ajax call response - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: ajax call response (/showthread.php?tid=335)



ajax call response - dimitrisscript - 11-04-2016

So I have built 3 ajax scripts that return some values from my database.
However, whenever I run these ajax calls, they all return the same response:

data returned:
--------------
<script>
// Place analytics code here
</script>

Case 1:
If I don't set a response, a response is sent anyway with the above data.

Case 2:
If I set a response eg. echo "test"; then the following response is received:

data returned:
--------------
<script>
// Place analytics code here
</script>
test

Case 3:
If I don't include init.php then the ajax calls behave as they should.

Obviously something is wrong here, because the only file i'm including is init.php

Conclusion:
So I went to /users/helpers/us_helpers.php and commented out line 22:
//require_once $abs_us_root.$us_url_root.'usersc/includes/analytics.php';

And the problem looks fixed for now.



ajax call response - dan - 11-04-2016

Hmm. That is extremely interesting.

Dang. I see it. I used php commenting out instead of html commenting out on that file. Can you see what happens if you change the commenting type or just delete line 24 on usersc/includes/analytics.php


ajax call response - Brandin - 11-05-2016

I noticed this happened two when I was having Data Updated values returned to my browser. I ended up just taking everything out of the custom analytics and it fixed it, however, I think the above would help.


ajax call response - mudmin - 11-05-2016

Yep. I can push that out for 4.1.8c.


ajax call response - mudmin - 11-05-2016

Yep. I can push that out for 4.1.8c.


ajax call response - dimitrisscript - 11-07-2016



Quote:Can you see what happens if you change the commenting type or just delete line 24 on usersc/includes/analytics.php

Sorry for the delay in replying.
Neither of these 2 solutions seemed to work for me.

Anyway, it seems that you have already fixed it, although the downloads aren't working for some reason so I can't download the patch and see what changed.

Happy to help anyway Smile


ajax call response - mudmin - 11-12-2016

Yeah. Sorry about that. I was doing the patch from the road and I goofed the link. It's all good now.