Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The script tried to execute a method or access a property of an incomplete object. #19

Open
blacksaltstudio opened this issue May 14, 2019 · 3 comments

Comments

@blacksaltstudio
Copy link

blacksaltstudio commented May 14, 2019

Getting this error a after doing a Craft 3 Update (Updated to V3.1.26)

lukeyouell\geocookie\services\GeoService::location(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "stdClass" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition

Attached is the full error page I get.

yii_base_ErrorException.htm.zip

@davist11
Copy link

davist11 commented Jun 6, 2019

I was running into this error as well. I think the plugin is not supported anymore; I submitted a pull request (#14) last October, and the issue was never fixed. Unfortunately, You may want to consider forking the plugin and using that version instead.

As for the fix, I was able to fix it with the following in services/Geocookie.php:

replace:

$location = $cookie->value;

with:

$location = @unserialize($cookie->value);

if ($location === false) {
    $location = $cookie->value;
}

and replace:

'value' => $location,

with:

'value' => serialize($location),

Hopefully that helps!

@benjamin-smith
Copy link

Thank you @davist11 I applied that same fix to a fork for a project we are working on.

benjamin-smith added a commit to benjamin-smith/craft-geocookie that referenced this issue Jul 23, 2019
bzin added a commit to Momkai/craft-geocookie that referenced this issue Feb 21, 2020
bzin added a commit to Momkai/craft-geocookie that referenced this issue Feb 21, 2020
bzin added a commit to Momkai/craft-geocookie that referenced this issue Feb 21, 2020
jasonwoodland pushed a commit to spicywebau/craft-geocookie that referenced this issue Aug 11, 2020
mrnebbi added a commit to mrnebbi/craft-geocookie that referenced this issue Mar 19, 2021
@kerns
Copy link

kerns commented Mar 28, 2021

@mrnebbi would you consider forking and maintaining this plugin for a while? Shame to see it go abandoned.

anthonyjc added a commit to therefinerynz/craft-geocookie that referenced this issue Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants