Skip Navigation

[Gelöst] Call to undefined function get_current_screen() in /classes/class.file.php

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 7 Antworten, has 3 Stimmen.

Last updated by Beda vor 4 Jahre, 3 Monate.

Assigned support staff: Beda.

Author
Artikel
#548053

Any time I try to update a post or page I get:
Fatal error: Call to undefined function get_current_screen() in /nas/content/staging/techwomen/wp-content/plugins/types/library/toolset/toolset-common/toolset-forms/classes/class.file.php on line 38

I fixed the issue on my end by adding require_once (ABSPATH . 'wp-admin/includes/screen.php');. Just curious if you guys are aware of this issue or have a fix in mind? Thanks!

#548103

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kristin,

Thank you for contacting our support forum.

Actually in doing some searching on this issue the only solution that came up is the one that you provided here.

There is a similar issue with the ACF plugin which was resolved by using this exact method.

Thanks,
Shane

#548109

Hi Shane,

Is there somewhere I can include this fix on my child theme or somewhere comparable that doesn't involve modifying the types plugin files?

#548373

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kristin,

Not that i'm aware of however I can report this issue and our development team should be able to provide a more permanent fix in an update.

Thanks,
Shane

#548379

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kristin,

It seems that this issue was already reported to the team. Also could you try reinstalling Types and see if the issue still remains because the issue could be due to corrupt files.

Thanks,
Shane

#549029

That error is mentioning a Core function of WordPress.
I have one other report of this, but I cannot replicate it.
There must be an edge case where the Core File wp-admin/includes/screen.php cannot be loaded when that code is triggered.

Please send me a Site's Snapshot, so I can analyse this.
I suspect this is a server issue, where the server or the WordPress install is customised in a way that does not allow the file to be read.
https://toolset.com/faq/provide-supporters-copy-site/

Thank you for the cooperation, once I have a site's snapshot I will be able to find the issue.

#549801

The issue seems Jetpack.
If removed/disconnected the issue should be gone.

I already escalated it to the Developers to have a look.
It seems to happen only if there is an Image Field in the Post Type and Jetpack is active.

#550240