Annotate PDF No longer loads after upgrade to 3.7

Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Number of replies: 21

Hi all

After upgrading our Moodle to 3.7, the Annotate PDF tool no longer loads for assignment feedback.  The left side of the screen just shows the spinning "loading" icon.  I've tested the converter and both Google and unoconv successfully generate a good sample pdf. There is no matching error in the logs, however when I look at the javascript console I see:

VM6774:7 Uncaught SyntaxError: Unexpected token }

    at p (jquery-3.2.1.min.js:1)

    at Ja (jquery-3.2.1.min.js:1)

    at r.fn.init.append (jquery-3.2.1.min.js:1)

    at z (first.js:7)

    at A (first.js:7)

    at Object.replaceNodeContents (first.js:7)

    at HTMLDivElement.<anonymous> (first.js:163)

    at HTMLDivElement.d.complete (jquery-3.2.1.min.js:1)

    at i (jquery-3.2.1.min.js:1)

    at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:1)

p @ jquery-3.2.1.min.js:1

Ja @ jquery-3.2.1.min.js:1

append @ jquery-3.2.1.min.js:1

z @ first.js:7

A @ first.js:7

replaceNodeContents @ first.js:7

(anonymous) @ first.js:163

d.complete @ jquery-3.2.1.min.js:1

i @ jquery-3.2.1.min.js:1

fireWith @ jquery-3.2.1.min.js:1

i @ jquery-3.2.1.min.js:1

r.fx.tick @ jquery-3.2.1.min.js:1

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

requestAnimationFrame (async)

eb @ jquery-3.2.1.min.js:1

%22:1 GET https://thehub.fsd38.ab.ca/%22https:////thehub.fsd38.ab.ca//theme//image.php//boost_campus//assignfeedback_editpdf//1566232494//nav_prev/%22 404 (Not Found)

I'm thinking the last line is the clue as it seems to list our url twice.  I've tried changing the theme, however the same error occurs.

Any ideas?

Thanks,

Doug

附件 Screen Shot 2019-08-19 at 10.58.35 AM.png
評比平均分數: -
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
One last piece. Turned debugging to maximum and received the following stack trace:
Error code: codingerror
* line 488 of /lib/pagelib.php: coding_exception thrown
* line 1544 of /lib/pagelib.php: call to moodle_page->magic_get_context()
* line 677 of /lib/pagelib.php: call to moodle_page->initialise_theme_and_output()
* line 820 of /lib/pagelib.php: call to moodle_page->magic_get_theme()
* line 26 of /theme/uikit/renderers.php: call to moodle_page->__get()
* line 790 of /lib/outputlib.php: call to include_once()
* line 697 of /lib/outputlib.php: call to theme_config->__construct()
* line 7353 of /lib/moodlelib.php: call to theme_config::load()
* line 702 of /lib/classes/user.php: call to get_list_of_themes()
* line 863 of /lib/classes/user.php: call to core_user::fill_properties_cache()
* line 1087 of /user/externallib.php: call to core_user::get_property_type()
* line 2853 of /mod/assign/externallib.php: call to core_user_external::user_description()
* line 124 of /lib/externallib.php: call to mod_assign_external::get_participant_returns()
* line 185 of /lib/externallib.php: call to external_api::external_function_info()
* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Ken Task發表於
Particularly helpful Moodlers的相片

In debug I see ... '/theme/uikit/'.  Is that a boost based theme?

Try inserting $CFG->theme='boost'; in config.php file and see if the problem doesn't go away.

Been some major changes in themes with 3.7.  3.7 has boost as default and one other core theme called 'classic'.

And before you try whatever again, purge the caches in moodledata ... either the Moodle UX Admin button or manually by hand moodledata/cache/ moodledata/localcache moodledata/muc/

Might even consider clearing browser cache! :|

'SoS', Ken

In reply to Ken Task

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於

Thanks. I've now done that, removed uikit and removed all boost dependant themes. Still no luck. 😢

In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
At this point I only have the following errors.
Apache:
Default exception handler: Your session has most likely timed out. Please log in again. Debug: \nError code: invalidsesskey\n* line 494 of /lib/setuplib.php: moodle_exception thrown\n* line 85 of /lib/sessionlib.php: call to print_error()\n* line 30 of /auth/oauth2/login.php: call to require_sesskey()\n

Browser:
VM9466:7 Uncaught SyntaxError: Unexpected token }
at p (jquery-3.2.1.min.js:1)
at Ja (jquery-3.2.1.min.js:1)
at r.fn.init.append (jquery-3.2.1.min.js:1)
at z (first.js:7)
at A (first.js:7)
at Object.replaceNodeContents (first.js:7)
at HTMLDivElement. (first.js:159)
at HTMLDivElement.d.complete (jquery-3.2.1.min.js:1)
at i (jquery-3.2.1.min.js:1)
at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:1)
p @ jquery-3.2.1.min.js:1
Ja @ jquery-3.2.1.min.js:1
append @ jquery-3.2.1.min.js:1
z @ first.js:7
A @ first.js:7
replaceNodeContents @ first.js:7
(anonymous) @ first.js:159
d.complete @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
r.fx.tick @ jquery-3.2.1.min.js:1
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
r.fx.start @ jquery-3.2.1.min.js:1
r.fx.timer @ jquery-3.2.1.min.js:1
kb @ jquery-3.2.1.min.js:1
g @ jquery-3.2.1.min.js:1
dequeue @ jquery-3.2.1.min.js:1
(anonymous) @ jquery-3.2.1.min.js:1
each @ jquery-3.2.1.min.js:1
each @ jquery-3.2.1.min.js:1
queue @ jquery-3.2.1.min.js:1
animate @ jquery-3.2.1.min.js:1
r.fn. @ jquery-3.2.1.min.js:1
k._niceReplaceNodeContents @ first.js:159
(anonymous) @ first.js:159
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
f. @ jquery-3.2.1.min.js:1
(anonymous) @ first.js:63
j @ jquery-3.2.1.min.js:1
k @ jquery-3.2.1.min.js:1
setTimeout (async)
(anonymous) @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
fire @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
f. @ jquery-3.2.1.min.js:1
f @ first.js:64
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
A @ jquery-3.2.1.min.js:1
(anonymous) @ jquery-3.2.1.min.js:1
load (async)
send @ jquery-3.2.1.min.js:1
ajax @ jquery-3.2.1.min.js:1
call @ first.js:64
c @ first.js:63
loadFragment @ first.js:63
(anonymous) @ first.js:159
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
f. @ jquery-3.2.1.min.js:1
(anonymous) @ first.js:159
d.complete @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
fireWith @ jquery-3.2.1.min.js:1
i @ jquery-3.2.1.min.js:1
r.fx.tick @ jquery-3.2.1.min.js:1
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
requestAnimationFrame (async)
eb @ jquery-3.2.1.min.js:1
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Okay, that's interesting. Disabling feedback comments solved it. Not sure why though, and would really like to be able to comment wink
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Ken Task發表於
Particularly helpful Moodlers的相片

Wonder if disabling feedback comments was really the solution ... reason ... in the error screens just above I saw oath2 authentication/token issue ... Google? 

If so, read something this AM that some Google customers in certain areas of the globe had issues with Google IAM (authentications) for a period of time ... fixed now!

'SoS', Ken


In reply to Ken Task

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Unfortunately no. That was just a search engine scan... not me. Just happened to show in the logs at the same time that I generated the error. I've confirmed that if either file upload feedback or comments feedback are on the issue happens. As soon as I turn either of them off it's fixed. The .js code that I pull down when the error occurs via Chrome's "Inspect" it shows that the js has one too many ( and one too few }. Haven't pinpointed where that's generated. Tried switching editors and removing all but the base theme as well to no avail. Good news is that it's usable again, but lost functionality for my teachers. sad
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Hi all, I've been fighting with this for the week now. I've removed as many 3rd party plugins as I can find. No change. Still:
* If both feedback comments and PDF Annotation are enabled, the page will not load "Unmatched }" is the error in the inspector.
* If only feedback comments is enabled it works fine
* If only PDF Annotation is enabled it works.

We're going to stick to leaving comments off and only using the inline comment tool to give feedback. Unfortunately this doesn't map to grades feedback. Is anyone else running into this or found a solution?
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Ken Task發表於
Particularly helpful Moodlers的相片

In config of Moodle,

admin/settings.php?section=assignfeedback_editpdf

Path to ghostscript

Please note that annotate PDF requires the path to ghostscript to be set in System paths.

and a Test ghostscript path link.

Did you try the Test path link?

'SoS', Ken

In reply to Ken Task

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Yes, and in both the unoconv and and Google conversion set ups I was able to generate and download the Sample document. So it works there, just not on the annotate side.
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Ken Task發表於
Particularly helpful Moodlers的相片

Well, I've been tinkering with this on a 3.7.highest and comparing with a 3.6.highest and have a couple of things to share.

in 3.7 there is now a global setting for document type (mimetypes/filename .extensions) and in *each* assignment there is a setting for which documents (mimetype/extensions) students will be allowed to submit.  3.6.x did not have that.   Thus, when upgrading 3.6 -> 3.7 moodle may not know what to do with that setting in each assignment ... defaults to none even though the global in DB and Moodle Admin interface shows a '*" ... meaning all.

Discovering that, changed that setting in an assignment to a document,.docx, logged on with a true dummy student account, uploaded a submission successfully - a .docx.

Then logged out.  Logged in as Teacher and found the same issue as you have described.  Would get a notice that not all documents can be converted and sure enough a blank page in annotation panel.

Checked the DB mdl_files table ... found saw references for assignfeedback_editpdf and contenthash.  Used contenthash to locate the file in moodledata/filedir/ ... showed a combined.pdf filename.

Usedfind /var/www/moodle37data/filedir/ -name 3b6616c3f2a0c7fd9a208a483e62fd1fde3c16a0

Got the path:

/var/www/moodle37data/filedir/3b/66/3b6616c3f2a0c7fd9a208a483e62fd1fde3c16a0

checked the mimetype:

file -b /var/www/moodle37data/filedir/3b/66/3b6616c3f2a0c7fd9a208a483e62fd1fde3c16a0
PDF document, version 1.3

Everything appears to have worked, but ... nothing to annotate. 傷心

Bug in 3.7.highest?   Works fine in 3.6.highest.

Even installed unoconv ... located the uploaded .docx and copied it out of moodledata/filedir to a work area, converted .docx to .pdf via unoconv and put the resulting .pdf file in web accessible area.  Browser works, shells it to 'preview' (on a Mac) and renders the converted PDF just fine.

Tinkered with the gs command to do same ... and then grew pretty tired ... shouldn't be having to do all that ....

BUG in 3.7.highest.

But no errors reported anywhere! 傷心

Anyhoo ... since it's only  two of us ... ????!!!!

'SoS', Ken

In reply to Ken Task

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
What's really weird that if you turn off written comments, the annotate loads with the pdf just fine. And, if you turn annotate off, the comment box loads just fine. You can use either successfully, just not both. sad
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

AL Rachels發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
Hi Doug,
I see the same thing with PDF...PDF annotate works with Feedback comments turned off. Although, in my case, Feedback comments works even when Annotate PDF is enabled, but not working. This is in a Moodle 3.7 just updated before testing and the site originally started out as a new 3.7 install for QA Testing.
In reply to AL Rachels

Re: Annotate PDF No longer loads after upgrade to 3.7

Ken Task發表於
Particularly helpful Moodlers的相片

@Al ... good to hear it's not just the two of us! :|

Always wanted to ask about QA testing ... is there a course backup that is used for QA testers?  Can it be acquired for 'omicron testers'?

TIA!

Ken

In reply to Ken Task

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Good to know that I'm not losing my mind. Not sure what the conflict is. I've even tried to turn off atto and tinymce to see if the editor code was causing the issue. No luck. I've removed all themes too since that can often cause issues.
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Walter DeMoss發表於

Just jumping in to see how I can help.  I desperately want this plugin to work.


In reply to Walter DeMoss

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Thanks Walter, Like I said above if feedback comments and annotate pdf are enabled in our weekly updated 3.7, neither loads. The error in the console is:
Uncaught SyntaxError: Unexpected token '}' with no error in the server logs. It partially draws both windows (pdf and comment) but none of the buttons or edit fields appear on either. If I turn either one off, the other works without issues.

More detailed:
view.php?id=43534&rownum=0&action=grader&userid=22762:7 Uncaught SyntaxError: Unexpected token '}'
at p (jquery-3.2.1.min.js:1)
at Ja (jquery-3.2.1.min.js:1)
at r.fn.init.append (jquery-3.2.1.min.js:1)
at A (first.js:7)
at B (first.js:7)
at Object.replaceNodeContents (first.js:7)
at HTMLDivElement. (first.js:159)
at HTMLDivElement.d.complete (jquery-3.2.1.min.js:1)
at i (jquery-3.2.1.min.js:1)
at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:1)
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Here's a latest screen shot.  As long as both Comments and Annotate PDF are enabled, this is what I get.

附件 Screen Shot 2019-10-03 at 6.54.40 PM.png
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

David Morrow發表於
Greetings,

This is probably not it, but only takes a few seconds to try. Select a student's name in the "Change user" drop-down near the top-right, even if a name is already displayed at the top of the page.

I finally got our PDF converter to work again after an upgrade from 3.5 to 3.7. I think ours was a Google problem, but I am not really sure - because it only works now if the teacher takes the extra step to select a name from that menu. Even though a student's name is displayed at the top of the page:

Select "Grade" by student's name:

grade button

Grading page loads (lots of spinning - no conversion):

PDF markup fail


Use drop-down to select student:

select name

Name does not display in "Change user" box, but converted submission loads:


PDF convert success



Anyway - that is working for us right now.

I noticed this after a re-working (for lack of a better term) our Google service used as the document converter. It may have all happened coincidentally, but a token expired and there seemed to be a problem with the system account I used for the past year in the Oauth2 settings. It may be that selecting the name form the menu would have worked without my other efforts.

I'm interested to see if this is occurring for anyone else.

Thanks,

David
In reply to Doug Stevens

Re: Annotate PDF No longer loads after upgrade to 3.7

Doug Stevens發表於
Solved!

I cloned a clean repo and started adding plugins from my production server until the clone broke.  The culprit for us was repository_capture. Once I removed it, everything started working. 

Cheers,
Doug
評比平均分數:Useful (2)