TypeError

Argument 2 passed to DOMNode::replaceChild() must be an instance of DOMNode, null given

/mnt/data/shnoulle/nginx/www/3LTS/application/models/TemplateManifest.php(860)

848      * @param string        $sDate         The wanted date, if empty the current date with config time adjustment will be used
849      */
850     public static function changeDateInDOM($oNewManifest, $sDate = '')
851     {
852         $date           = (empty($date)) ?dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust")) : $date;
853         $oConfig        = $oNewManifest->getElementsByTagName('config')->item(0);
854         $ometadata = $oConfig->getElementsByTagName('metadata')->item(0);
855         $oOldDateNode   = $ometadata->getElementsByTagName('creationDate')->item(0);
856         $oNvDateNode    = $oNewManifest->createElement('creationDate', $sDate);
857         $ometadata->replaceChild($oNvDateNode, $oOldDateNode);
858         $oOldUpdateNode = $ometadata->getElementsByTagName('last_update')->item(0);
859         $oNvDateNode    = $oNewManifest->createElement('last_update', $sDate);
860         $ometadata->replaceChild($oNvDateNode, $oOldUpdateNode);
861     }
862 
863     /**
864      * Change the template name inside the manifest (called from template editor)
865      * NOTE: all tests (like template exist, etc) are done from template controller.
866      *
867      * @param string $sOldName The old name of the template
868      * @param string $sNewName The newname of the template
869      */
870     public static function rename($sOldName, $sNewName)
871     {
872         libxml_disable_entity_loader(false);

Stack Trace

#0
+
 /mnt/data/shnoulle/nginx/www/3LTS/application/models/TemplateManifest.php(860): DOMNode->replaceChild(DOMElement, null)
855         $oOldDateNode   = $ometadata->getElementsByTagName('creationDate')->item(0);
856         $oNvDateNode    = $oNewManifest->createElement('creationDate', $sDate);
857         $ometadata->replaceChild($oNvDateNode, $oOldDateNode);
858         $oOldUpdateNode = $ometadata->getElementsByTagName('last_update')->item(0);
859         $oNvDateNode    = $oNewManifest->createElement('last_update', $sDate);
860         $ometadata->replaceChild($oNvDateNode, $oOldUpdateNode);
861     }
862 
863     /**
864      * Change the template name inside the manifest (called from template editor)
865      * NOTE: all tests (like template exist, etc) are done from template controller.
#1
+
 /mnt/data/shnoulle/nginx/www/3LTS/application/models/TemplateManifest.php(979): TemplateManifest::changeDateInDOM(DOMDocument)
974         libxml_disable_entity_loader(false);
975         $oNewManifest = self::getManifestDOM($sConfigPath);
976 
977         self::deleteEngineInDom($oNewManifest);
978         self::changeNameInDOM($oNewManifest, $sNewName);
979         self::changeDateInDOM($oNewManifest);
980         self::changeAuthorInDom($oNewManifest);
981         self::changeEmailInDom($oNewManifest);
982         self::changeExtendsInDom($oNewManifest, $sToExtends);
983 
984         $oNewManifest->save($sConfigPath."/config.xml");
#2
+
 /mnt/data/shnoulle/nginx/www/3LTS/application/controllers/admin/themes.php(576): TemplateManifest::extendsConfig("skelvanilla", "extends_skelvanilla")
571 
572                 if ($mkdirresult == 1) {
573                     // We just copy the while directory structure, but only the xml file
574                     $oFileHelper->copyDirectory($copydirname, $newdirname, array('fileTypes' => array('xml', 'png', 'jpg'), 'newDirMode' => 0755));
575                     //TemplateConfiguration::removeAllNodes($newdirname);
576                     TemplateManifest::extendsConfig($copydir, $newname);
577                     TemplateManifest::importManifest($newname, ['extends' => $copydir]);
578                     $this->getController()->redirect(array("admin/themes/sa/view", 'templatename'=>$newname));
579                 } elseif ($mkdirresult == 2) {
580                     Yii::app()->setFlashMessage(sprintf(gT("Directory with the name `%s` already exists - choose another name"), $newname), 'error');
581                     $this->getController()->redirect(array("admin/themes/sa/view", 'templatename'=>$copydir));
2020-06-10 10:16:06 nginx/1.18.0 Yii Framework/1.1.22-dev