2016-06-01 9 views
1

私が作成したエンタープライズ版のMagento Moduleは、最初に設定したときに問題なく動作しました。今度はMagentoが(404が見つかりませんでした2)、それが正常に動作する前に、何も変更されていませんパーミッションはコードを持っていない、以下のいくつかの抜粋を落とすが基本的なパッケージ情報をheres、コントローラはフロントエンドではなく、エラーなしで起動します。Magentoモジュール無作為に停止しました

パッケージ名/名前空間:Jejamescycles
モジュール名:金融
Codepool:コミュニティ
アクティブ:真

最初のファイル - アプリ/コード/コミュニティ/ Jejamescycles /ファイナンス/コントローラ/ IndexController.php

<?php 

    class Jejamescycles_Finance_IndexController extends Mage_Core_Controller_Front_Action{ 
     public function indexAction(){ 

      $conn = Mage::getSingleton('core/resource')->getConnection('core_read'); 

      $conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_sales` 
      (
       `sales_id` INT(11) NOT NULL AUTO_INCREMENT, 
       `sales_reference` VARCHAR(50) NOT NULL UNIQUE, 
       `customer_id` INT(11) NOT NULL , 
       `products` TEXT NOT NULL , 
       `total_price` VARCHAR(255) NOT NULL , 
       `status` VARCHAR(4) NOT NULL , 
       PRIMARY KEY(`sales_id`) 
      )"); 



      $this->loadLayout(); 

      $block = $this->getLayout()->createBlock(
               'Mage_Core_Block_Template', 
               'v12content' 
               ) 
            ->setTemplate('v12_finance/index.phtml'); 
      $this->getLayout()->getBlock('content')->append($block); 

      $this->renderLayout(); 

     } 
     private function _getCustomerSession() { 
      Mage::getSingleton('core/session', array('name' => 'frontend')); 
      return Mage::getSingleton('customer/session'); 
     } 
     function successAction() 
     { 

      $reference = $_GET['REF']; 
      $sales_reference = $_GET['SR']; 
      $status = $_GET['Status']; 
      $auth = $_GET['Auth']; 

      $conn = Mage::getSingleton('core/resource')->getConnection('core/read'); 

      $confirmed = 0; 

      if($status == 'A' || $status == 'S') 
      { 
       $confirmed = 1; 
      } 
      try{ 

       $conn->query("UPDATE `v12_finance_sales` SET `confirmed` = '$confirmed' , `status` = '$status' WHERE `sales_reference` = '$sales_reference'"); 

       $this->loadLayout(); 

       $this->renderLayout(); 

      }catch(Exception $e) 
      { 
       $fh = fopen("FINANCE_LOG.log" , "a+"); 
       fwrite($fh , "ERROR[" . date('H:i:s d-m-Y') . ']:EXCEPTION:' . $e->getMessage()); 
       fclose($fh); 

       $conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_errors` 
       (
        `error_id` int(11) not null AUTO_INCREMENT, 
        `sales_reference` VARCHAR(200) NOT NULL , 
        `status` VARCHAR(4) NOT NULL , 
        PRIMARY KEY(`error_id`) 
       )"); 

       $conn->query("INSERT INTO `v12_finance_errors` 
        (
         `sales_reference` , 
         `status` 
        ) VALUES (
         '" . $sales_reference . "' , 
         '$status' 
        )"); 

       die("There was an error processing this request, please contact <a href='mailto:[email protected]'>Support</a> with this URL"); 
      } 

     } 
     function basic_infoAction() 
     { 
      $conn = Mage::getSingleton('core/resource')->getConnection('core/read'); 

      // $conn->query("ALTER TABLE `v12_finance_sales` ADD COLUMN `status` varchar(4) NOT NULL"); 
      if(!Mage::getSingleton('customer/session')->isLoggedIn()){ 
       //not logged in 

       header("Location: http://" . $_SERVER['SERVER_NAME'] . "/customer/account"); 

      }else{ 
       $this->loadLayout(); 

       $block = $this->getLayout()->createBlock(
                'Mage_Core_Block_Template', 
                'v12content' 
                ) 
             ->setTemplate('v12_finance/finance_setup.phtml'); 
       $this->getLayout()->getBlock('content')->append($block); 

       $this->renderLayout(); 
      } 

     } 
} 

?>

そして、config.xmlファイル:

<config> 
<!-- ... --> 
    <frontend> 
     <routers> 
      <!-- the <helloworld> tagname appears to be arbitrary, but by 
      convention is should match the frontName tag below--> 
      <jejamescycles_finance> 
       <use>standard</use> 
       <args> 
        <module>Jejamescycles_Finance</module> 
        <frontName>jejamescycles_finance</frontName> 
       </args> 
      </jejamescycles_finance> 
     </routers> 
    </frontend> 
    <global> 
     <helpers> 
      <finance> 
       <!-- Helper definition needed by Magento --> 
       <class>Jejamescycles_Finance_Helper</class> 
      </finance> 
     </helpers> 
     <blocks> 
      <jejamescycles_finance> 
      <class>Jejamescycles_Finance_Block</class> 
      </jejamescycles_finance> 
     </blocks> 
    </global> 
    <admin> 
     <routers> 
      <adminhtml> 
       <args> 
        <modules> 
         <jejamescycles_finance before="Mage_Adminhtml">Jejamescycles_Finance_Adminhtml</jejamescycles_finance> 
        </modules> 
       </args> 
      </adminhtml> 
     </routers> 
    </admin> 
<!-- ... --> 
</config> 

ませ環境変数が変更されていない、モジュール自体が独立したとdoesntのですが、他のパッケージに依存し、それがない理由、私は私の人生のために把握することはできませんワーキング。私はCMSページもチェックしており、URLキーの衝突はありません。

答えて

0

私はconfig.xmlに変更しました:

<config> 
<!-- ... --> 
    <frontend> 
     <routers> 
      <!-- the <helloworld> tagname appears to be arbitrary, but by 
      convention is should match the frontName tag below--> 
      <finance> 
       <use>standard</use> 
       <args> 
        <module>Jejamescycles_Finance</module> 
        <frontName>finance</frontName> 
       </args> 
      </finance> 
     </routers> 
    </frontend> 
    <global> 
     <helpers> 
      <finance> 
       <!-- Helper definition needed by Magento --> 
       <class>Jejamescycles_Finance_Helper</class> 
      </finance> 
     </helpers> 
     <blocks> 
      <jejamescycles_finance> 
      <class>Jejamescycles_Finance_Block</class> 
      </jejamescycles_finance> 
     </blocks> 
    </global> 
    <admin> 
     <routers> 
      <adminhtml> 
       <args> 
        <modules> 
         <jejamescycles_finance before="Mage_Adminhtml">Jejamescycles_Finance_Adminhtml</jejamescycles_finance> 
        </modules> 
       </args> 
      </adminhtml> 
     </routers> 
    </admin> 
<!-- ... --> 
</config> 

そして、これが働いている、それはしかし働いていなかった理由、それはまだ私をバッフル、これはオリジナルのconfig.xmlファイルだったと仕事をしました。

関連する問題