<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi all,<br>
</p>
<p>I noted an issue with the JavaScript I provided for generating
IRStats2 download graphs on eprint abstract pages. The below
JavaScript should work better as I have noticed that when you try
to use an epc:pin a second or third time it will be empty:</p>
<p> google.setOnLoadCallback( function(){ drawChart_eprint(
'<epc:pin name='eprintid'/>' ) } );<br>
function drawChart_eprint( irstats2_summary_page_eprintid
){<br>
<br>
/* $( 'irstats2_summary_page:link' ).setAttribute(
'href', '/cgi/stats/report/eprint/' +
irstats2_summary_page_eprintid ); */<br>
<br>
new EPJS_Stats_GoogleGraph ( { 'context': {<br>
'range':'1y',<br>
'set_name': 'eprint',<br>
'set_value':
irstats2_summary_page_eprintid,<br>
'datatype':'downloads' },<br>
'options': {<br>
'container_id':
'irstats2_summary_page_downloads',
'date_resolution':'month','graph_type':'column'<br>
} } );<br>
}<br>
</p>
<p>Regards</p>
<p>David Newman<br>
</p>
<div class="moz-cite-prefix">On 09/10/2020 11:31, David R Newman
wrote:<br>
</div>
<blockquote type="cite" cite="mid:5db0535e-e8b4-2f36-1fd6-51f79b0d8b25@ecs.soton.ac.uk">
<p>Hi James,</p>
<p>I cannot remember off hand what caching issues you may need to
deal with. First rule is always make sure you reload the
webserver after making the changes. Then on any pages you load
make sure your hard refresh (e.g. Ctrl+Shift+R). If you have
download graphs on abstract/summary pages I think you will need
to run refresh abstracts. <br>
</p>
<p>This definitely fixed the issue for me and I had several
independent people test this to confirm.<br>
</p>
<p>Regards</p>
<p>David Newman<br>
</p>
<div class="moz-cite-prefix">On 09/10/2020 11:20, James Kerwin
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAKkNZ9ApX2Z7XR-Gs-qdJBzer5-UWF4Zn9xQ5kfbNrgCQcPnAA@mail.gmail.com">
<div dir="ltr">Hi David,
<div><br>
</div>
<div>Thank you very much. I'll make the necessary changes
today and see how we get on. I wouldn't have worked this out
if I had centuries to look at it.</div>
<div><br>
</div>
<div>I did try changing the load in /cfg.d/<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fz_irstats2.pl%2F&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866099123%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jXG%2Fw0P8eKsBnEg2XUg6auIDkIyTPh60V%2F78NtQQLyc%3D&reserved=0" originalSrc="http://z_irstats2.pl/" shash="oV/WrljU+YKnK12fsLo8esYGD1lZFQRIPMyDfn/9vYvjOSu5wP2VmINL9Re59t6KwYxpx4K/vON/rvHRPxW0upx3ajVCWPkWgHDxutekG5QhuuPumZ3dlyusGcUpkQV5RdvvwVkYsdjKOdZgnP8rejApUgZ5vkSA9N7D4Ti6TEA=" originalsrc="http://z_irstats2.pl/" shash="n/soc8CunmfPwteQtxyxroYMmdqq5Jid3RrKhBILvpl8B9ty+lRL6c3OiQ10SQLCYfk62QPMhlzKF33GpxEcdLuQ+fZvZ7Xqxousj3yAHmaRKkefkhDtRYsbY9HoM78XYk2RgXnrMbbyEhiyWNe36Wkw6VgsvzHt1axRIuPHwTU=" target="_blank" moz-do-not-send="true">z_irstats2.pl</a>
in line with this:</div>
<div><br>
</div>
<div><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopers.google.com%2Fchart%2Finteractive%2Fdocs%2Fbasic_load_libs%23update-library-loader-code&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866099123%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hO4pw4SCUmgY2uyXDHRZ%2FN41YrEhv2Ik%2FeEel%2FXTpdg%3D&reserved=0" originalSrc="https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code" shash="IBHHU5RUy+EscLFiV7gFiVts1q1pOgaD6X7lF9Okx2COHkaGU0ixl9GC4HQ/rPZZjrzMcw9C6bUMbNcMEtYN9zIhY91JPF5hbXbJD8+52eY2XFxDG0uzcZ6x7TKeXtTIcjfYmgogxMGeUaj6YVmjXVFTfMch9z/PXjUTb0ekKpU=" originalsrc="https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code" shash="n+tpUpm3oazaPm92xmakn5K0AD/3preXRf3x1AdovWljzBgeDUyaHZwq+I9LHTZ2gvQITLGBg0W+J7VzGQfSpNyNyRQ0avThiQvNVukkmkVTr6yH7l7VSXhlVObRdGBHP3LYduyBWtkEeUDcL6P4k1OLRVRLITeo3VS5hc1nrJI=" target="_blank" moz-do-not-send="true">https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code</a> <br>
</div>
<div><br>
</div>
<div>This particular attempt didn't solve the problem, but it
didn't break it either and it did change the load method
when I inspected it (in Chrome when you look at the HTML
etc).<br>
<br>
Anyway I better get on with these changes, thank you for the
guidance, appreciated as ever!</div>
<div><br>
</div>
<div>Thanks,</div>
<div>James</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Oct 8, 2020 at 9:32
AM David R Newman <<a href="mailto:drn@ecs.soton.ac.uk" target="_blank" moz-do-not-send="true">drn@ecs.soton.ac.uk</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi James,</p>
<p>Yes, I have noticed this as well. I fixed by change
the following block of code in
EPrints/Plugin/Stats/View.pm</p>
<p>125 if( document.loaded )<br>
126 new EPJS_Stats_$js_class( {
'context': $json_context, 'options': $view_options } );<br>
127 else<br>
128
document.observe("dom:loaded",function(){<br>
129 new
EPJS_Stats_$js_class( { 'context': $json_context,
'options': $view_options } );<br>
130 });</p>
<p>to:</p>
<p> 125
google.setOnLoadCallback(drawChart_$id);<br>
126 function drawChart_$id()<br>
127 {<br>
128 new EPJS_Stats_$js_class( {
'context': $json_context, 'options': $view_options } );<br>
129 <br>
130 }</p>
<p>I also made a similar change in
EPrints/Plugin/Stats/View/KeyFigures.pm as well. If you
have download stats boxes on abstract/summary pages you
will also need to make a similar change to one of the
phrases in lang/en/phrases/irstats2.xml.</p>
<p>Regards</p>
David Newman
<div>On 08/10/2020 08:51, James Kerwin via Eprints-tech
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi All,<br>
<div><br>
</div>
<div>I updated IRStats2 to the most recent version
back in May (I think it was 1.01 to 1.1) from the
Bazaar.</div>
<div><br>
</div>
<div>All seemed well until this week when I looked and
realised there was no data. since the upgrade. It
turns out it was because of the permissions and
ownership of the process_stats file which is
supposed to run frequently to process the stats and
I assume update the irstats2_ tables in the
database.</div>
<div><br>
</div>
<div>After the upgrade the script was owned by
www-data (whatever it's called) and the "eprints"
user didn't have permission to execute it. Due to
the "no output" options set in cron I wasn't getting
any info.</div>
<div><br>
</div>
<div>It was my fault for not being thorough enough and
it's all sorted now, but I thought I would offer
this as a warning to anybody who upgrades and
doesn't know to check this sort of thing.<br>
<br>
Also the IRStats2 pages stay "loading" forever on
Chrome, but load almost immediately on FireFox. Any
idea what causes this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>James</div>
</div>
<br>
<fieldset></fieldset>
<pre>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" target="_blank" moz-do-not-send="true">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866109113%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pzKjvqQgh8VoVspI%2F71815uZdbv64CVzWrw1DErmeSU%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="UVgdMbzRWd03fkugl03e5DD6kEL7WNcA9rvWxPXNXzaWA2Kk5IXGTznJncxt5fBd2//8qDEOlpefVE9hIUmG6QU3A+79sEodEav697Xk6d1sL17sU/RJfS1lAswkwrlBsQtzbuOknL2IUjhJOJeQ4yNS7+7dQJT5UX5Bbf2p1mM=" originalsrc="http://www.eprints.org/tech.php/" shash="HC06qqT/nmbO06GswT/Mspd332pGGKnT0z0hqCbvYuDdtW/LAZt/2qFthUKunv5GDP45aWVLeBz13g3SduU0jKRvFx7VDTBXHz8OXHo6PK1d6vfv2F7ghCNKn9QVAM81+J2fgwsltDq5TpR/4gD8VJdPs6EggmbDVjOdoZtrAZY=" target="_blank" moz-do-not-send="true">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866119113%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uAyBMbQzbDtPuav0T7TNXmlPhcSA5TDzXErNZs24LcE%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="SN3BhGosLgRCA9OsF15OzPbp2joAMGErKUaT5ZSqmTnCTCPP/ldbb/2shsRaeTMMzSh84SWra+dQgLPy3+Hs3sYrHbhKIS2M8EIBl1rTU3EoNmG8NP8Kx4j0KBdmBS5AbfHTaxXTS6qGOi9mkjtlxLJSCMI8gDO77yQvTrGxSys=" originalsrc="http://wiki.eprints.org/" shash="qLwNJkeP42fEp4vrS9asnT7t9C6v+iylHslOr7Yaqh58jpR71x1FRyxslZnRw8aLsR9ypO79eELqxc0IQv526eClmKhJpC/4RByggL+OMGu20A5/cXyRinnf0Hf7N1NtEQXN5UQQMnMys7mrO/AJDP7m5xmcZEsKSOV+HbQTd9s=" target="_blank" moz-do-not-send="true">http://wiki.eprints.org/</a></pre>
</blockquote>
<div id="gmail-m_8275029250304110295gmail-m_5935789201647633706DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid rgb(211,212,222)">
<tbody>
<tr>
<td style="width:55px;padding-top:13px"><a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866119113%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1CpUTCnHx6YI8OSCraPnJzNMO8NzHWPWrVNfdLvSV%2B0%3D&reserved=0" originalSrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="ggar+n6fvqqyHG0JGyDi2m0UexWBxrNodCQGyhbGtykjQDKBFlj9FRbNDItgO2g/wHjy3Ch11BhF0hPbXuf2gBc/4ET48hly6qooBujE3NgZ4utWGqG4r6LtRXcCvgfqoOtSY0CpwzEpTQzZwC4RBLOdP2ZjFK/x9yc0u9kXSDI=" originalsrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="fuviqavMALWSQB2bq42Sg0Cci4s+evlulCQ8NmzWGVsSPaRKTI6u0nr9CrgdgMFnt6nXj0v7bmSOmcMdqC+z8KB8BDVIjmsZT7SI/Vd+PMktLw8WkgZGF8hz6CeuLY+QGOpIO5h8r8d8N/WZO1LnLdgbnEzXmN9wHFlp4YhvPe4=" target="_blank" moz-do-not-send="true"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png" alt="" style="width: 46px; height: 29px;" moz-do-not-send="true" width="46" height="29"></a></td>
<td style="width:470px;padding-top:12px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free.
<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866129103%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l7Apfi7p9ttMHoFKFx33Jw1BR0dMnYCGa9F7%2FlXJYJY%3D&reserved=0" originalSrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="drMH+GubT6y3WhuVnHRhT2t6Xpw34xefBVjgJsLj5OWb0p/jsil2TBT7EOnHkZtro0SbQ3RLapUDIz2NFkVVO0s3A4Ms7PNr6Th2P/7hsulKEF8bTougUhAGIKM+O1tzcqsmVqrGBxOWtNMnQhAqNcklUrDug2K4KI4e4vPCPeI=" originalsrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="fuviqavMALWSQB2bq42Sg0Cci4s+evlulCQ8NmzWGVsSPaRKTI6u0nr9CrgdgMFnt6nXj0v7bmSOmcMdqC+z8KB8BDVIjmsZT7SI/Vd+PMktLw8WkgZGF8hz6CeuLY+QGOpIO5h8r8d8N/WZO1LnLdgbnEzXmN9wHFlp4YhvPe4=" style="color:rgb(68,83,234)" target="_blank" moz-do-not-send="true">www.avg.com</a> </td>
</tr>
</tbody>
</table>
<a href="#m_8275029250304110295_m_5935789201647633706_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1" moz-do-not-send="true"> </a></div>
</div>
</blockquote>
</div>
</blockquote>
</blockquote>
</body>
</html>