• Resolved Vipa

    (@vipa)


    WordPress 5.0.3
    WP Google Maps Version 7.11.03

    Hey,

    when I add a map to a page, save and close it and then try to edit the page again, I get a white page. Preview of the page works though, but I can′t edit it anymore.
    Using the new Gutenberg editor.

    WP_DEBUG shows this:

    
    Fatal error: Using $this when not in object context in /var/www/vhosts/comtag.biz/httpdocs/wp-content/plugins/wp-google-maps/includes/class.plugin.php on line 163 
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there

    Thank you for getting in touch, our apologies for any inconvenience caused.

    Could you please try opening the specified file, and replacing that entire function with

    public function loadScripts()
    	{
    		$self = $this;
    		
    		if(!$this->scriptLoader)
    			$this->scriptLoader = new ScriptLoader($this->isProVersion());
    		
    		if(!empty($this->settings->developer_mode))
    			$this->scriptLoader->build();
    		
    		if(Plugin::$enqueueScriptsFired)
    		{
    			$this->scriptLoader->enqueueScripts();
    			$this->scriptLoader->enqueueStyles();
    		}
    		else
    		{
    			foreach(Plugin::$enqueueScriptActions as $action)
    			{
    				add_action($action, function() use ($self) {
    					$self->scriptLoader->enqueueScripts();
    					$self->scriptLoader->enqueueStyles();
    				});
    			}
    		}
    	}

    You should fine that will solve this message.

    Please try that and let us know, and we’ll get that patched in as soon as possible.

    Does that help?

    Kind regards
    – Perry

    • This reply was modified 6 years, 1 month ago by perryrylance.
    Thread Starter Vipa

    (@vipa)

    Hey,

    thanks for your reply.
    I tried to replace the code.
    After doing so the whole site was not reachable anymore.
    Debub showed the following:

    Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /var/www/vhosts/comtag.biz/httpdocs/wp-content/plugins/wp-google-maps/includes/class.plugin.php on line 165

    This line seems to be responsible:
    add_action($action, function() use $self {

    • This reply was modified 6 years, 1 month ago by Vipa.

    Hi there

    Can you please add brackets around $self like this:

    ($self) on that line, and that will solve the issue there.

    Please could you confirm following applying that fix?

    Kind regards
    – Perry

    Thread Starter Vipa

    (@vipa)

    Hey Perry,

    this fixed it, thank you very much!

    Thread Starter Vipa

    (@vipa)

    Does todays patch (7.11.04) already include the fix?

    perryrylance

    (@perryrylance)

    Hi there

    It certainly does ??

    Is there anything else we can help you with?

    Kind regards
    – Perry

    Thread Starter Vipa

    (@vipa)

    Hi Perry,

    all good thanks, just wanted to be sure before updating ??

    EDIT: just updated, everything works smoothly!

    • This reply was modified 6 years ago by Vipa.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘New Editor shows empty page’ is closed to new replies.