Page Editor - delete_draft_content() function does not exist

Page Editor - delete_draft_content() function does not exist

by Eva E -
Number of replies: 4

Hi,

The annotate pdf cron fails with error "Exception - Call to undefined method assignfeedback_editpdf\page_editor::delete_draft_content()"

Indeed the function delete_draft_content() does not exist. How could we go about this? How can it be that a function in the code base is being used but does not exist?

Any advice is greatly appreciated.


Average of ratings: -
In reply to Eva E

Re: Page Editor - delete_draft_content() function does not exist

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Eva,

Which version of Moodle are you using? Do you in fact have a document converter installed/setup/enabled?

In reply to AL Rachels

Re: Page Editor - delete_draft_content() function does not exist

by Eva E -

Hi Al, 

Using version 3.3.2 and yes we have the Google converter set up and document conversion works.

The issue here is with a function being referenced that does not exist which prevents the cron from completing.

In reply to Eva E

Re: Page Editor - delete_draft_content() function does not exist

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The function certainly looks like it should be there in the code: 

https://github.com/moodle/moodle/blob/MOODLE_33_STABLE/mod/assign/feedback/editpdf/classes/page_editor.php#L392

Can you double-check you really have all of the code for Moodle 3.3.2? (And try updating to the latest version - 3.3.4, although that function has been there fro approx 4 years, so it is unlikely that it's a problem with a particular minor version of Moodle).


In reply to Davo Smith

Re: Page Editor - delete_draft_content() function does not exist

by Eva E -

Hi Davo, you are certainly right it appears the function got removed somehow during a merge with our custom code, will have to look into how to merge cleanly to avoid something like this is the future.

For anyone else, there was also an error for another undefined function "move_to_trash()", this has a fix here https://github.com/moodle/moodle/commit/5ca85a1efe7fcab9c989567169506ee4829c2e89 .

Thank you!