Skip to content

Commit

Permalink
Merge pull request #12 from magmodules/1.2.3
Browse files Browse the repository at this point in the history
Invalidation fix and added min php version to selftest
  • Loading branch information
Marvin-Magmodules authored Mar 17, 2018
2 parents 8a48d65 + 40e9b74 commit 07fa7bd
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function runTests()
{
$result = array();

if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
$result[] = $this->getPass('Compatible PHP version: ' . PHP_VERSION);
} else {
$result[] = $this->getFail('Module requires PHP version >= 5.4, current version: ' . PHP_VERSION);
}

if ($this->getEnabled()) {
$result[] = $this->getPass('Channable API Module Enabled');
} else {
Expand Down
4 changes: 4 additions & 0 deletions app/code/community/Magmodules/Channableapi/Model/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public function addToLog($type, $msg, $level = 6, $force = false)
*/
public function invalidateProduct($productId, $type, $reason = null)
{
if ($productId < 1) {
return;
}

$items = $this->getCollection()
->addFieldToFilter(
array('product_id', 'parent_id'),
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Magmodules/Channableapi/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<config>
<modules>
<Magmodules_Channableapi>
<version>1.2.2</version>
<version>1.2.3</version>
</Magmodules_Channableapi>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Magmodules.eu - http://www.magmodules.eu
*
* NOTICE OF LICENSE
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Magmodules
* @package Magmodules_Channableapi
* @author Magmodules <[email protected]>
* @copyright Copyright (c) 2018 (http://www.magmodules.eu)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();

try {
$installer->run("ALTER TABLE {$this->getTable('channable_items')} ADD INDEX parent_id(parent_id);");
} catch (Exception $e) {
Mage::log($e->getMessage());
}

$installer->endSetup();
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magmodules/magento1-channable-api",
"type": "magento-module",
"description": "Magento 1 Channable integration",
"version": "v1.2.0",
"version": "v1.2.3",
"keywords": [
"magento"
],
Expand Down

0 comments on commit 07fa7bd

Please sign in to comment.