Frappe.desk.form.utils has no attribute 'validate_link'

So I deployed this server for production a few days back and found out the wkhtmltopdf was not working coz of some qt_patch, and so i reinstalled it using bench install wkhtmltopdf from my bench folder. Afterwards it started showing error as the below image.

I dont know what to do with this. I used git stash and bench update --reset. I’ve already added hostname to the site_config file of the appropos site.

wkhtmltopdf is now solved and is printing and generating pdf appropriately but now I get this error evertime i open print format builder or any doctype list…

PS I checked once more. It seems that wherever there is print format connected all those doctypes are showing this error. Its not picking old print formats I created before.

UPDATE 1: Just found out, none of the functions are working now. Basically the Doctype selection in any form isn’t working. Gives the same error everywhere be it receipts or orders or any selection with a link Doctype. Might try to migrate site to see if it works.

do bench build

Nope, still not working. Gives the same error on the same pages.

OKAY. I don’t know how but I shifted the website to development mode and it automatically corrected itself. No error and all the things are working. Then shifted it to production again and it works correctly now. Seems like a problem during bench setup production [user] the first time around or maybe updating wkhtmltopdf in production mode broke it. I Will mark this as the answer in case it doesn’t break in the next few days.