2012-05-11 14 views
0

私の人生が本当に私のドメインのMagentoのバックエンドに入るのに苦労しています。私は数回再インストールして、私はちょっとしたエラーが出ることなく入り込むことができません。Magento致命的なエラー:14.9行目のJs.phpの非オブジェクト上のgetAttribute()メンバ関数を呼び出す

致命的なエラー:行に/app/code/core/Mage/Core/Helper/Js.php内の非オブジェクトのメンバ関数のgetAttribute()の呼び出し149

この1は最新のものです上記のエラーは私が管理領域にログインするとポップアップし、私が見る唯一のことです。キャッシュをクリアして、別のブラウザを使用します(FirefoxとChromeの最新バージョンを試しました)。同じエラーです。

誰かが私を助けてくれますか?私はこれを数日前から行ってきました。私自身でこれを理解しようとしています。しかし、私はすべてのアイデアがありません。ありがとう!

Js.phpファイルは以下

<?php 

クラスMage_Core_Helper_Js IS Mage_Core_Helper_Abstract {/ ** * キャッシュのキー*/ CONST JAVASCRIPT_TRANSLATE_CONFIG_KEY = 'javascript_translate_config' を延び、

/** 
* Translate file name 
*/ 
const JAVASCRIPT_TRANSLATE_CONFIG_FILENAME = 'jstranslator.xml'; 

/** 
* Array of senteces of JS translations 
* 
* @var array 
*/ 
protected $_translateData = null; 

/** 
* Translate config 
* 
* @var Varien_Simplexml_Config 
*/ 
protected $_config = null; 

/** 
* Retrieve JSON of JS sentences translation 
* 
* @return string 
*/ 
public function getTranslateJson() 
{ 
    return Mage::helper('core')->jsonEncode($this->_getTranslateData()); 
} 

/** 
* Retrieve JS translator initialization javascript 
* 
* @return string 
*/ 
public function getTranslatorScript() 
{ 
    $script = 'var Translator = new Translate('.$this->getTranslateJson().');'; 
    return $this->getScript($script); 
} 

/** 
* Retrieve framed javascript 
* 
* @param string $script 
* @return script 
*/ 
public function getScript($script) 
{ 
    return '<script type="text/javascript">//<![CDATA[ 
    '.$script.' 
    //]]></script>'; 
} 

/** 
* Retrieve javascript include code 
* 
* @param string $file 
* @return string 
*/ 
public function includeScript($file) 
{ 
    return '<script type="text/javascript" src="'.$this->getJsUrl($file).'"></script>'."\n"; 
} 

/** 
* Retrieve 
* 
* @param string $file 
* @return string 
*/ 
public function includeSkinScript($file) 
{ 
    return '<script type="text/javascript" src="'.$this->getJsSkinUrl($file).'"></script>'; 
} 

/** 
* Retrieve JS file url 
* 
* @param string $file 
* @return string 
*/ 
public function getJsUrl($file) 
{ 
    return Mage::getBaseUrl('js').$file; 
} 

/** 
* Retrieve skin JS file url 
* 
* @param string $file 
* @return string 
*/ 
public function getJsSkinUrl($file) 
{ 
    return Mage::getDesign()->getSkinUrl($file, array()); 
} 

/** 
* Retrieve JS translation array 
* 
* @return array 
*/ 
protected function _getTranslateData() 
{ 
    if ($this->_translateData === null) { 
     $this->_translateData = array(); 
     $messages = $this->_getXmlConfig()->getXpath('*/message'); 
     if (!empty($messages)) { 
      foreach ($messages as $message) { 
       $messageText = (string)$message; 
       $module = $message->getParent()->getAttribute("module"); 
       $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module 
       )->__($messageText); 
      } 
     } 

     foreach ($this->_translateData as $key => $value) { 
      if ($key == $value) { 
       unset($this->_translateData[$key]); 
      } 
     } 
    } 
    return $this->_translateData; 
} 

/** 
* Load config from files and try to cache it 
* 
* @return Varien_Simplexml_Config 
*/ 
protected function _getXmlConfig() 
{ 
    if (is_null($this->_config)) { 
     $canUsaCache = Mage::app()->useCache('config'); 
     $cachedXml = Mage::app()->loadCache(self::JAVASCRIPT_TRANSLATE_CONFIG_KEY); 
     if ($canUsaCache && $cachedXml) { 
      $xmlConfig = new Varien_Simplexml_Config($cachedXml); 
     } else { 
      $xmlConfig = new Varien_Simplexml_Config(); 
      $xmlConfig->loadString('<?xml version="1.0"?><jstranslator></jstranslator>'); 
      Mage::getConfig()->loadModulesConfiguration(self::JAVASCRIPT_TRANSLATE_CONFIG_FILENAME, $xmlConfig); 

      if ($canUsaCache) { 
       Mage::app()->saveCache($xmlConfig->getXmlString(), self::JAVASCRIPT_TRANSLATE_CONFIG_KEY, 
        array(Mage_Core_Model_Config::CACHE_TAG)); 
      } 
     } 
     $this->_config = $xmlConfig; 
    } 
    return $this->_config; 
} 

}

答えて

0

あなたはキャッシュをクリア?どうやって?セッションもクリアしましたか?私たちには今すぐ機能があります。つまり、毎回手動でこれらをクリアしてから、管理者になる必要があります。これは、SSHシェルから出力された...

var# ls 
./ ../ cache/ export/ locks/ log/ package/ pear/ report/ session/ 
var# rm -rf cache/* 
var# rm -rf session/* 

は、だから私は、私たちのスタッフがSSHせずにそれを行うことができますので、それを行うには、ウェブページ/ PHPスクリプトを書いた:

<pre><?php 
$output; 
$retval; 
$errors=""; 
$command="pwd"; 
exec ($command , &$output, &$retval ); 
$path=$output[0]; 
unset($output); 
echo "rm -rf $path/var/cache/*\n"; 
if(0) { // change to 1 after seeing the above looks ok! 
    $command="rm -rf $path/var/cache/*"; 
    exec ($command , &$output, &$retval ); 
    echo "<b>$command</b> returned $retval\n"; 
    if($retval > 0) 
     $errors .= "There was a problem deleting cache files.\n"; 
    // ------------------------------------------------ 
    $command="ls -alh $path/var/cache"; 
    exec ($command , &$output, &$retval ); 
    echo "<b>$command</b> returned $retval; the directory listing should only have . and ..\n\$output:"; 
    print_r($output); 
    unset($output); 
    // ------------------------------------------------ 
    $command="rm -rf $path/var/session/*"; 
    exec ($command , &$output, &$retval ); 
    echo "<b>$command</b> returned $retval\n"; 
    if($retval > 0) 
     $errors .= "There was a problem deleting session files.\n"; 
    // ------------------------------------------------ 
    $command="ls -alh $path/var/session"; 
    exec ($command , &$output, &$retval ); 
    echo "<b>$command</b> returned $retval; the directory listing should only have . and ..\n\$output:"; 
    print_r($output); 
    unset($output); 
} 
if(strlen($errors) == 0) 
    echo "<h2>Yaay! you can get into admin again...</h2>"; 
else 
    echo "<h2 style=\"color:red\">Boo! something went wrong...</h2>$errors\n"; 
?></pre> 

場合は変更後( 「ユーザ名」は、あなたの割り当てられたユーザ名であることを

rm -rf /home/username/public_html/var/cache/* 
rm -rf /home/username/public_html/var/cache/* returned 0 
ls -alh /home/username/public_html/var/cache returned 0; the directory listing should only have . and .. 
$output:Array 
(
    [0] => total 16K 
    [1] => drwxrwxrwx 2 username username 4.0K May 13 19:42 . 
    [2] => drwxr-xr-x 10 username username 4.0K May 10 15:17 .. 
) 
rm -rf /home/username/public_html/var/session/* returned 0 
ls -alh /home/username/public_html/var/session returned 0; the directory listing should only have . and .. 
$output:Array 
(
    [0] => total 248K 
    [1] => drwxrwxrwx 2 username username 232K May 13 19:42 . 
    [2] => drwxr-xr-x 10 username username 4.0K May 10 15:17 .. 
) 
Yaay! you can get into admin again... 

注:0)これは、出力がどのように見えるべきかである(私は__cache_clear.phpそれを呼ばれる)1に、このファイルを訪問している場合ウェブホスティング会社とは異なります。私はMagentoフォルダに置かれるとスクリプトが動的になり、適切に動作します。

関連する問題