__clone method called on non-object

Permalink 1 user found helpful
Hello,

Has anyone come across the following error when adding a new page?

__clone method called on non-object


A page draft is still created and can be edited afterwards, but this error prevents the page from automatically opening in composer on page creation.

concrete5 Version - 8.1.0

shoutmediaca
 
mnakalay replied on at Permalink Best Answer Reply
mnakalay
Hello,

I see it too, same version.

For a quick fix, you can modify concrete/src/Page/Page.php. line 2913 you have
$value = clone $value;
$nc->setAttribute($attribute->getAttributeKey(), $value);

Modify it to
if (is_object($value)) {
    $value = clone $value;
    $nc->setAttribute($attribute->getAttributeKey(), $value);
}
shoutmediaca replied on at Permalink Reply
shoutmediaca
Your quick fix worked. Thanks!

I tracked the issue to a missing row in the atFile table in the database.

No idea what would have caused that.
Ta2Ta2 replied on at Permalink Reply
this worked for me too! thanks..
ob7dev replied on at Permalink Reply
ob7dev
After updating a clients site from 8.0 to 8.1 I am also receiving this error.
Opened an issue: https://github.com/concrete5/concrete5/issues/5429...
Thanks mnakalay for quick fix.