Bug #23447 Bug Fixed

Error when creating a new channel by duplicating existing channel that has been duplicated before.

Version: 4.0.6 Reporter: Russ K.

When I create a new channel and I duplicate an existing, if i have duplicated that channel before I get an error. If instead, I select a channel to duplicate that has NOT been duplicated before it works fine.

This is the error returned: Fatal error: __clone method called on non-object in /home/stpclient/public_html/system/ee/EllisLab/ExpressionEngine/Model/Channel/Channel.php on line 331

R

  • In system/ee/EllisLab/ExpressionEngine/Model/Channel/Channel.php around line 328 replace”

    $this->FieldGroups = clone $channel->FieldGroups;
    $this->CustomFields = clone $channel->CustomFields;
    $this->Statuses = clone $channel->Statuses;
    $this->ChannelFormSettings = clone $channel->ChannelFormSettings;

    with

    foreach (['FieldGroups', 'CustomFields', 'Statuses', 'ChannelFormSettings'] as $rel)
    {
       if ($channel->$rel)
       {
           $this->$rel = clone $channel->$rel;
       }
    }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases