Skip to content

Commit

Permalink
Merge branch 'hotfix/2.5.15'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jul 2, 2019
2 parents f080efc + d20d41c commit 151a854
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 34 deletions.
32 changes: 4 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
# Ignore everything (useful to ignore the whole Contao installation)
/*

# Do not ignore ".gitignore"
!.gitignore
!.tx
!composer.json
!build.xml.dist
!README.md

# Isotope ignoring rules
!isotope/
isotope/*
!isotope/.htaccess
!isotope/index.html
!system/
system/*
!system/modules
system/modules/*
!system/modules/isotope/*
!system/modules/isotope_reports/*
!system/modules/isotope_rules/*
/system/modules/isotope/config/runonce.php

# Gulp and node modules
!gulpfile.js
!package.json
node_modules/
/vendor/
/node_modules/
/composer.lock
/.php_cs.cache
6 changes: 6 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ Isotope eCommerce Changelog
===========================


Version 2.5.15-stable (2019-07-02)
----------------------------------

- Cumulative filter incorrectly handled checkbox fields (#1933)


Version 2.5.14-stable (2019-06-11)
---------------------------------

Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/library/Isotope/Isotope.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Isotope extends \Controller
/**
* Isotope version
*/
const VERSION = '2.5.14';
const VERSION = '2.5.15';

/**
* True if the system has been initialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ public function getValue(IsotopeProduct $product)
$value = parent::getValue($product);

if ($this->multiple) {
if (IsotopeAttributeWithOptions::SOURCE_TABLE === $this->optionsSource
|| IsotopeAttributeWithOptions::SOURCE_FOREIGNKEY === $this->optionsSource
if ((
IsotopeAttributeWithOptions::SOURCE_TABLE === $this->optionsSource
|| IsotopeAttributeWithOptions::SOURCE_FOREIGNKEY === $this->optionsSource
) && $this->csv === ','
) {
$value = explode(',', $value);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public function prepareOptionsWizard($objWidget, $arrColumns)
*/
public function saveToDCA(array &$arrData)
{
parent::saveToDCA($arrData);

$this->multiple = true;

parent::saveToDCA($arrData);

if (!$this->variant_option && $this->optionsSource === IsotopeAttributeWithOptions::SOURCE_NAME) {
$arrData['fields'][$this->field_name]['eval']['multiple'] = false;
$arrData['fields'][$this->field_name]['sql'] = "char(1) NOT NULL default ''";
$arrData['fields'][$this->field_name]['options'];
unset($arrData['fields'][$this->field_name]['options']);
} else {
$arrData['fields'][$this->field_name]['eval']['multiple'] = true;
$arrData['fields'][$this->field_name]['sql'] = 'blob NULL';
Expand Down
66 changes: 66 additions & 0 deletions system/modules/isotope/library/Isotope/Upgrade/To0020050150.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/**
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009-2017 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @link https://isotopeecommerce.org
* @license https://opensource.org/licenses/lgpl-3.0.html
*/

/**
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009-2016 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @link https://isotopeecommerce.org
* @license https://opensource.org/licenses/lgpl-3.0.html
*/

namespace Isotope\Upgrade;

use Contao\Database;

class To0020050150 extends Base
{
public function run($blnInstalled)
{
if (!$blnInstalled) {
return;
}

$attributes = Database::getInstance()->execute(
"SELECT field_name FROM tl_iso_attribute WHERE type='checkbox' AND (optionsSource='table' OR optionsSource='foreignKey')"
)->fetchEach('field_name');

if (empty($attributes)) {
return;
}

$fields = implode(', ', $attributes);

$products = Database::getInstance()->execute("SELECT id, $fields FROM tl_iso_product")->fetchAllAssoc();

foreach ($products as $product) {
$update = [];

foreach ($attributes as $attribute) {
if (0 !== strpos($product[$attribute], 'a:')) {
continue;
}

$value = deserialize($product[$attribute]);

if (\is_array($value)) {
$update[$attribute] = implode(',', $value);
}
}

if (empty($update)) {
continue;
}

Database::getInstance()->prepare("UPDATE tl_iso_product %s WHERE id=?")->set($update)->execute($product['id']);
}
}
}

0 comments on commit 151a854

Please sign in to comment.