Skip to content

Commit

Permalink
Merge branch 'hotfix/2.5.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jan 8, 2019
2 parents 43c5c3d + e92e559 commit e95d8b2
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 25 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
# Do not ignore ".gitignore"
!.gitignore
!.tx
!README.md
!composer.json
!.scrutinizer.yml
!.travis.yml
!build.xml.dist
!README.md

# Isotope ignoring rules
!isotope/
Expand Down
34 changes: 34 additions & 0 deletions build.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<project name="Isotope eCommerce" default="list" basedir=".">
<target name="list">
<echo message="Available commands:" />
<echo message=" phing tx-pull - Pulls language files from Transifex" />
<echo message=" phing tx-sync - Syncs language files with Transifex" />
</target>

<target name="tx-pull">
<echo message="Starting Transifex sync" />
<exec executable="tx" passthru="true">
<arg value="pull" />
<arg value="--all" />
<arg value="--minimum-perc=50" />
</exec>
</target>

<target name="tx-sync">
<echo message="Starting Transifex sync" />
<exec executable="tx" passthru="true">
<arg value="push" />
<arg value="-s" />
</exec>
<echo message="Waiting 10 seconds for sources to be parsed" />
<exec executable="sleep">
<arg value="10" />
</exec>
<exec executable="tx" passthru="true">
<arg value="pull" />
<arg value="--all" />
<arg value="--minimum-perc=50" />
</exec>
</target>
</project>
1 change: 1 addition & 0 deletions system/modules/isotope/dca/tl_iso_product_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function() {
(
'id' => 'primary',
'pid' => 'index',
'page_id' => 'index',
)
),
),
Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_wishlistviewer'] = '{title_legend},name,headline,type;{config_legend},iso_config_ids;{redirect_legend},jumpTo;{template_legend},customTpl,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_wishlistdetails'] = '{title_legend},name,headline,type;{redirect_legend:hide},iso_cart_jumpTo;{template_legend},customTpl,iso_collectionTpl,iso_orderCollectionBy,iso_gallery,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_configswitcher'] = '{title_legend},name,headline,type;{config_legend},iso_config_ids;{template_legend},customTpl,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_productfilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_enableLimit,iso_filterFields,iso_filterHideSingle,iso_searchFields,iso_searchAutocomplete,iso_sortingFields,iso_listingSortField,iso_listingSortDirection;{template_legend},customTpl,iso_filterTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_productfilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_enableLimit,iso_filterFields,iso_filterHideSingle,iso_searchFields,iso_searchAutocomplete,iso_sortingFields,iso_listingSortField,iso_listingSortDirection;{template_legend},iso_filterTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_cumulativefilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_cumulativeFields,iso_filterHideSingle;{template_legend},customTpl,navigationTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_rangefilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_rangeFields;{template_legend},customTpl,navigationTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_addressbook'] = '{title_legend},name,headline,type;{config_legend},nc_notification;{template_legend},customTpl,memberTpl,tableless,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
Expand Down
10 changes: 10 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.5.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Isotope eCommerce Changelog
===========================

Version 2.5.10-stable (2019-01-08)
----------------------------------

- Do not count skipped checkout steps in the page title (#2006)
- Use the frontend preview event to preview category pages in Contao 4
- Fixed coupon merging after member login (#1998)
- Fixed SQL_FULL_GROUP_BY issue when duplicating products (#1992)
- Fixed default value for doNotCopy in DC_ProductData


Version 2.5.9-stable (2018-11-15)
---------------------------------

Expand Down
18 changes: 15 additions & 3 deletions system/modules/isotope/drivers/DC_ProductData.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,22 @@ protected function copyChilds($table, $insertID, $id, $parentId)
continue;
}

// Reset all unique, doNotCopy and fallback fields to their default value
if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['unique'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['fallback'])
// Never copy passwords
if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['inputType'] == 'password')
{
$vv = '';
$vv = \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']);
}

// Empty unique fields or add a unique identifier in copyAll mode
elseif ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['unique'])
{
$vv = (\Input::get('act') == 'copyAll') ? $vv .'-'. substr(md5(uniqid(mt_rand(), true)), 0, 8) : \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']);
}

// Reset doNotCopy and fallback fields to their default value
elseif ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['fallback'])
{
$vv = \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']);

// Use array_key_exists to allow NULL (see #5252)
if (array_key_exists('default', $GLOBALS['TL_DCA'][$v]['fields'][$kk]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ class Category extends \Backend
*/
public function updateSorting($insertId)
{
$objCategories = \Database::getInstance()->query('
SELECT c1.*, MAX(c2.sorting) AS max_sorting
FROM tl_iso_product_category c1
LEFT JOIN tl_iso_product_category c2 ON c1.page_id=c2.page_id
WHERE c1.pid=' . (int) $insertId . '
GROUP BY c1.page_id'
);
$objCategories = \Database::getInstance()->prepare('
SELECT id, page_id
FROM tl_iso_product_category
WHERE pid=?'
)->execute($insertId);

while ($objCategories->next()) {
\Database::getInstance()->query('
\Database::getInstance()->prepare('
UPDATE tl_iso_product_category
SET sorting=' . ($objCategories->max_sorting + 128) . '
WHERE id=' . $objCategories->id
);
SET sorting=(SELECT max_sorting FROM (SELECT MAX(sorting) AS max_sorting FROM tl_iso_product_category WHERE page_id=?) subq)+128
WHERE id=?'
)->execute($objCategories->page_id, $objCategories->id);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public function listRows($row)
*/
public function getPageViewButton($href, $label, $title, $class, $attributes, $table, $root)
{
if (version_compare(VERSION, '4.0', '>=')) {
return '';
}

$objPage = \PageModel::findWithDetails(\Input::get('page_id'));

if (null === $objPage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public function registerContainerConfiguration(LoaderInterface $loader, array $m
->setArguments(['%kernel.root_dir%'])
->addTag('kernel.event_listener', ['event' => 'console.terminate'])
);

$container->setDefinition(
'isotope.listener.frontend_preview',
(new Definition('Isotope\EventListener\FrontendPreviewListener'))
->addTag('kernel.event_listener', ['event' => 'contao.preview_url_create', 'method' => 'onPreviewUrlCreate'])
);
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Isotope\EventListener;

use Contao\CoreBundle\Event\PreviewUrlCreateEvent;

class FrontendPreviewListener
{
public function onPreviewUrlCreate(PreviewUrlCreateEvent $event)
{
if ($event->getKey() !== 'iso_products' || \Input::get('table') !== 'tl_iso_product_category' || !\Input::get('page_id')) {
return;
}

$event->setQuery('page=' . \Input::get('page_id'));
}
}
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.9';
const VERSION = '2.5.10';

/**
* True if the system has been initialized
Expand Down
2 changes: 2 additions & 0 deletions system/modules/isotope/library/Isotope/Module/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ protected function generateSteps(array $arrSteps)

if ($this->skippableSteps[$step]) {
unset($arrStepKeys[array_search($step, $arrStepKeys)]);
$intCurrentStep -= 1;
$intTotalSteps -= 1;
}

if ($step == $this->strCurrentStep) {
Expand Down
16 changes: 10 additions & 6 deletions system/modules/isotope_rules/library/Isotope/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,18 @@ public function cleanRuleUsages(&$objModule)

/**
* Transfer coupons from one cart to another. This happens if a guest cart is moved to user cart.
* @param IsotopeProductCollection
* @param IsotopeProductCollection
* @param array
*
* @param IsotopeProductCollection $oldCollection
* @param IsotopeProductCollection $newCollection
*/
public function transferCoupons($objOldCollection, $objNewCollection, $arrIds)
public function transferCoupons(IsotopeProductCollection $oldCollection, IsotopeProductCollection $newCollection)
{
if ($objOldCollection instanceof Cart && $objNewCollection instanceof Cart) {
$objNewCollection->coupons = $objOldCollection->coupons;
if ($oldCollection instanceof Cart && $newCollection instanceof Cart) {
$oldCoupons = deserialize($oldCollection->coupons, true);
$newCoupons = deserialize($newCollection->coupons, true);

$newCollection->coupons = array_unique(array_merge($oldCoupons, $newCoupons));
$newCollection->save();
}
}

Expand Down

0 comments on commit e95d8b2

Please sign in to comment.