From da49ddf2ff19ab269524033ee6a7d67657adc24f Mon Sep 17 00:00:00 2001 From: mosky17 Date: Tue, 3 Nov 2015 15:55:42 -0300 Subject: [PATCH] BUGFIX: duplicate index inclusion, new api library block missing. --- .../SagePaySuite/Block/ApiLibrary.php | 36 +++++++++++++++++++ .../mysql4-upgrade-3.0.25-3.0.27.php | 4 --- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 app/code/local/Ebizmarts/SagePaySuite/Block/ApiLibrary.php diff --git a/app/code/local/Ebizmarts/SagePaySuite/Block/ApiLibrary.php b/app/code/local/Ebizmarts/SagePaySuite/Block/ApiLibrary.php new file mode 100644 index 0000000..168454f --- /dev/null +++ b/app/code/local/Ebizmarts/SagePaySuite/Block/ApiLibrary.php @@ -0,0 +1,36 @@ + + */ +class Ebizmarts_SagePaySuite_Block_ApiLibrary extends Mage_Core_Block_Template +{ + + /** + * Return URL for API Library + * + * @return string + */ + public function getAPIUrl() + { + $piModel = Mage::getModel('sagepaysuite/sagePayNit'); + return $piModel->getUrl("api"); + } + + /** + * Disable url inclusion if not enabled + * + * @return string + */ + protected function _toHtml() + { + if(false === Mage::getStoreConfigFlag('payment/sagepaynit/active')){ + return ''; + } + return parent::_toHtml(); + } +} \ No newline at end of file diff --git a/app/code/local/Ebizmarts/SagePaySuite/sql/sagepaysuite_setup/mysql4-upgrade-3.0.25-3.0.27.php b/app/code/local/Ebizmarts/SagePaySuite/sql/sagepaysuite_setup/mysql4-upgrade-3.0.25-3.0.27.php index 08aab06..7734613 100644 --- a/app/code/local/Ebizmarts/SagePaySuite/sql/sagepaysuite_setup/mysql4-upgrade-3.0.25-3.0.27.php +++ b/app/code/local/Ebizmarts/SagePaySuite/sql/sagepaysuite_setup/mysql4-upgrade-3.0.25-3.0.27.php @@ -4,10 +4,6 @@ $installer->startSetup(); -$installer->run(" - ALTER TABLE `{$this->getTable('sagepaysuite_transaction')}` ADD INDEX `IDX_SAGEPAYSUITE_TRANSACTION_CREATED_AT` (`created_at`); -"); - $installer->run(" ALTER TABLE `{$this->getTable('sagepaysuite_transaction')}` CHANGE `integration` `integration` ENUM('direct','server','form','nit') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; ");