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

Exception thrown with Caching turned on #104

Closed
peteeveleigh opened this issue Mar 28, 2022 · 10 comments
Closed

Exception thrown with Caching turned on #104

peteeveleigh opened this issue Mar 28, 2022 · 10 comments

Comments

@peteeveleigh
Copy link

I think I'm seeing something related to this issue but with version 1.3.15

With caching turned on in the plugin settings I am getting a "Please check you URL" error in the field and the following Exception on page:

Serialization of 'DOMDocument' is not allowed

1. in /srv/users/production/apps/production/vendor/yiisoft/yii2/caching/Cache.php at line 249
240241242243244245246247248249250251252253254255256257258    {
        if ($duration === null) {
            $duration = $this->defaultDuration;
        }
 
        if ($dependency !== null && $this->serializer !== false) {
            $dependency->evaluateDependency($this);
        }
        if ($this->serializer === null) {
            $value = serialize([$value, $dependency]);
        } elseif ($this->serializer !== false) {
            $value = call_user_func($this->serializer[0], [$value, $dependency]);
        }
        $key = $this->buildKey($key);
 
        return $this->setValue($key, $value, $duration);
    }
 
    /**

However this is only happening on my production server. Both staging and local dev are working OK.

Any ideas? We need to have caching on to prevent hitting YT's fair use limits.

@peteeveleigh
Copy link
Author

UPDATE: This appears to be related to the PHP version.
Works OK on PHP 7.4 but throws the error on PHP 8.1

@reganlawton
Copy link
Member

THis should be resolved in the 2.0.0 release soon

@tomkiss
Copy link

tomkiss commented Jun 8, 2022

Hi @reganlawton -

I'm seeing this error on PHP 8 and Craft 3 with version 2.0.0 1.3.15.

Is there any plan to fix on the Craft 3 release?

@reganlawton
Copy link
Member

It's not possible 2.0.0 is branch for Craft v4 the composer.json shouldn't never let Craft v3 install cos the plug-in extended classes require PHP 8.0.2 minimum via Craft v4. This is why I set a MAJOR release and not a MINOR version. It's weird that your trying to install v2.0.0 if your using Craft v3 🤔

@reganlawton
Copy link
Member

You should set the composer.json to ^1.3.0 or something to keep it too v1 which will be the future fixes for Craft v3

@tomkiss
Copy link

tomkiss commented Jun 8, 2022

Thanks @reganlawton

Oh no, I'm still on 1.3.15 and wasn't trying to install 2.X (I had read the release number on the Github page, so my previous comment was wrong!), I only recently saw this error on PHP 8 and Craft 3.
I've probably had the bug a while but just not noticed it before, although thankfully it doesn't affect many pages. 😬

@reganlawton
Copy link
Member

I COULD let craft 3 would I believe but we'd need to be Craft v3 but with PHP 8 and I don't even know off the top of my head if that's supported haha. It's abit annoying cos it's only a few changes in the plug-in that actually impacted but PHP 8 😩 maybe one day I can look into issue but most people are looking at Craft v4 now so there's that to consider

@tomkiss
Copy link

tomkiss commented Jun 8, 2022

Ok sure thing 🙌

@reganlawton
Copy link
Member

I've found this stupid bug and "fixed" it in v2.x, AKA PHP 8 version, by converting the Embed class that gets cached from a Class to JSON string and back to StdClass, I think this will be the way to go. It snapshots the object but solves the issue. Don't know WHY it started happening, probably from the core package I use, but I'm sorry this took so long to "figure out" I've just been so under the pump. This will be resolved tomorrow, it's currently 1:45am here in Melbourne, AU but turning cache off for now resolves it.

@reganlawton
Copy link
Member

Just to summary the v1 branch will be updated and tagged with a new v1.x version 🍻

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

3 participants