• Hi

    I am getting the error

    AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function EnableMediaReplace\\get_current_screen() in /var/www/httpdocs/wp-content/plugins/enable-media-replace/classes/emr-plugin.php:263\nStack trace:\n#0 /var/www/httpdocs/wp-includes/class-wp-hook.php(288): EnableMediaReplace\\EnableMediaReplacePlugin->attachment_editor(Array, Object(WP_Post))\n#1 /var/www/httpdocs/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)\n#2 /var/www/httpdocs/wp-admin/includes/media.php(1883): apply_filters('attachment_fiel...', Array, Object(WP_Post))\n#3 /var/www/httpdocs/wp-includes/media.php(3573): get_compat_media_markup(30360, Array)\n#4 /var/www/httpdocs/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php(263): wp_prepare_attachment_for_js(Object(WP_Post))\n#5 /var/www....'

    running enable-media-replace 3.3.10 on php 7.3.15.

    error appears to be here and looks to have been somewhat fixed but not cleaned up –

    I delete the code $current_screen = get_current_screen();

    the issue is resolved.

    diff:

    
    --- a/www/httpdocs/wp-content/plugins/enable-media-replace/classes/emr-plugin.php	2020-03-03 14:44:44.797102948 +0000
    +++ b/www/httpdocs/wp-content/plugins/enable-media-replace/classes/emr-plugin.php	2020-03-03 14:45:07.793228023 +0000
    @@ -309,7 +309,6 @@
    
       public function display_notices() {
    -  	$current_screen = get_current_screen();
    
       	$crtScreen = function_exists("get_current_screen") ? get_current_screen() : (object)array("base" => false);
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @noeleon,

    Can you please tell us what page builder you are using? Also, can you tell us step-by-step how to reproduce this issue?

    Thank you!

    Thread Starter noeleon

    (@noeleon)

    Hi @sixaxis

    The site is using WPBakery Page Builder 6.1.

    To replicate the issue we enable the enable-media-replace plugin and the main landing page generates the error.

    As said before it looks like it was fixed previously but not cleaned up:

    
    public function display_notices() {
       $current_screen = get_current_screen();
    
    

    $current_screen is not used anywhere else in emr-plugin.php / display_notices?

    when I remove that line the problem goes away.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Thank you @noeleon,

    I’d want to further look into the issue with our developers. Could you please send us an email via this contact form and mention this conversation?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call to undefined function EnableMediaReplace\ get_current_screen’ is closed to new replies.