Closed rjsears closed 9 years ago
Can you open the developer console (Ctrl + Shift + I) and reload the page to see if it is spitting out any javascript errors?
Yep - here is what it spit out:
history.php:165 Uncaught SyntaxError: missing ) after argument list
Hmm, by the looks of it, that is the sAjaxSource, is it possible there is a open parens in the oDb serialized data? Or would the single quote take care of that.
@rjsears, could you check like 165 on that page and provide it here?
Not sure what you are asking @timrettop - Do you want me to copy line 165 from the history.php file and paste it here or...?
Yeah, sorry I wasn't clear.
FriendlyName.source = JSON.parse('{"saracannonhoover":"Sara Hoover","rsears":"Richard Sears","sammy308":"Sammy Reese","bdavis008":"Becky Davis","desertmansd":"Ted Petrina","rsears+plex for vizio (vizio mtk)":"Rick Creighton","rsears+dana's i pad":"Dana Hoover iPad","smpxone":"Ryan Miller","rsears+office":"RJS Home Office","rsears+plex for sony (playstation 4 01.17)":"Ryan Miller","bphoover":"Bill Hoover","rsears+my sm-t330nu":"Freddie Manuel","rsears+darryl's ipad":"Darryl Hoover iPad","logan700":"Logan Stuard"}');
The above is from the output of Chrome. (CMD+Option+J).
The actual history.php file does not have 165 lines, only 157 lines (/var/www/plexwatchweb/history.php)
Here is 161 through 172:
<!-- Start generated Jquery from serverdatapdo.php -->
<script type="text/javascript">
function FriendlyName(user) {
if (!FriendlyName.hasOwnProperty('source')) {
FriendlyName.source = JSON.parse('{"saracannonhoover":"Sara Hoover","rsears":"Richard Sears","sammy308":"Sammy Reese","bdavis008":"Becky Davis","desertmansd":"Ted Petrina","rsears+plex for vizio (vizio mtk)":"Rick Creighton","rsears+dana's i pad":"Dana Hoover iPad","smpxone":"Ryan Miller","rsears+office":"RJS Home Office","rsears+plex for sony (playstation 4 01.17)":"Ryan Miller","bphoover":"Bill Hoover","rsears+my sm-t330nu":"Freddie Manuel","rsears+darryl's ipad":"Darryl Hoover iPad","logan700":"Logan Stuard"}');
}
if (FriendlyName.source.hasOwnProperty(user.toLowerCase())) {
return FriendlyName.source[user.toLowerCase()];
} else {
return user;
}
}
Yeah, its because server datapdatapdo.php is called in history.php generating more output than the original file.
was there supposed to be more in your last comment, I only see the one line.
Yes, I put line 165 up a few comments above as that is where it said the error was, then I also put lines 161 - 172. But the spacing was kind of messed up a bit.
So that line is part of my "dirty hack" of outputting the json_encode()'d friendly name database and then parsing that in the javascript to get the database into the client side code...
Can you go to line 173 in serverdatapdo.php and after that put var_dump($friendlyname_json);
so it should look like:
}
$friendlyName_json = json_encode($friendlyName);
var_dump($friendlyName_json);
/* Edit Jqeury Here */
$js= <<<EOT
If you load up history.php after that it should put a bunch of junk into the page (and the table will probably be broken). Right click on the page-> View source and copy the line that has all that output in it.
Either paste it here or look over it yourself to make sure that it is properly escaping any ' marks in there. I'll see if I can reproduce the issue on my side.
Reproduced it here, looking into what it will take to get PHP's json_encode() to behave.
Checkout the latest dev branch, that should fix things for you. Sorry about that!
Closing for now, please re-open if the issue is still present on your setup.
Problem Solved. Thank You @Arcanemagus
Running the latest dev branch and the history tab only shows a blank screen (no history information) with a note that it is: "Loading data from server".
This was prior to updating to the latest dev branch:
This was after updating to the latest dev branch: