Skip to content

Commit

Permalink
Merge branch 'hotfix/2.1.11' into support/2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Feb 10, 2015
2 parents cd92e68 + 3043cca commit ff8255b
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.tx/source/*
!README.md
!composer.json
!.travis.yml

# Isotope ignoring rules
!isotope/
Expand Down
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: php
php:
- 5.3
- 5.4
- 5.5

env:
- CONTAO_VERSION="3.2.*"
- CONTAO_VERSION="3.3.*"

sudo: false

install:
- mysql -e 'CREATE DATABASE isotope_core_testsuite;'
- composer config repositories.contao composer "https://legacy-packages-via.contao-community-alliance.org/"
- sed '$d' composer.json | sed '$d' > composer.new
- 'echo ''},"prefer-stable": true,"minimum-stability": "dev"}'' >> composer.new'
- mv composer.new composer.json
- composer require contao/core:${CONTAO_VERSION} --no-update
- composer update
- cp -R system/modules/isotope vendor/contao/core/system/modules/isotope
- cp -R system/modules/isotope_reports vendor/contao/core/system/modules/isotope_reports
- cp -R system/modules/isotope_rules vendor/contao/core/system/modules/isotope_rules
- cd vendor/contao/core
- rm -rf vendor
- ln -s ../../ ./vendor
- cd system/modules/isotope
- cp test/fixtures/travis/initconfig.php ../../config/initconfig.php
- cp test/fixtures/travis/langconfig.php ../../config/langconfig.php
- cp test/fixtures/travis/localconfig.php ../../config/localconfig.php
- cp test/fixtures/travis/pathconfig.php ../../config/pathconfig.php

script: phpunit --configuration test/phpunit.xml --bootstrap test/bootstrap.php ./test
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"contao/core":">=3.2.13,<3.4",
"contao-community-alliance/composer-plugin":"2.*",
"contao-legacy/conditionalselectmenu":"2.*",
"terminal42/namespace-class-loader":">=1.0.1,<2.0",
"terminal42/contao-namespace-class-loader":">=1.0.1,<2.0",
"terminal42/dcawizard":">=2.0.2,<3.0",
"codefog/contao-haste":"~4.2",
"menatwork/contao-multicolumnwizard": "~3.2",
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 @@ -29,7 +29,7 @@
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_orderhistory'] = '{title_legend},name,headline,type;{config_legend},iso_config_ids;{redirect_legend},jumpTo;{template_legend},iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_orderdetails'] = '{title_legend},name,headline,type;{config_legend},iso_loginRequired;{template_legend},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},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_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;{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_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_filterFields,iso_filterHideSingle;{template_legend},navigationTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_addressbook'] = '{title_legend},name,headline,type;{template_legend},memberTpl,tableless,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_relatedproducts'] = '{title_legend},name,headline,type;{config_legend},iso_related_categories,numberOfItems,perPage;{redirect_legend},iso_addProductJumpTo;{template_legend:hide},iso_list_layout,iso_gallery,iso_cols,iso_use_quantity,iso_includeMessages,iso_emptyMessage,iso_buttons;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
Expand Down
14 changes: 14 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Isotope eCommerce Changelog
===========================

Version 2.1.11-stable (2015-02-10)
----------------------------------

### Improved
- Setting for "reference page" was not visible in the product filter module
- Product group popup does no longer apply the active group filter

### Fixed
- Composer installer could not find namespace class loader dependency
- Taxes for shipping address were not applied before checkout
- Gallery only included the last JavaScript template on AJAX request (#1357)
- Possible message when product has no price attribute (#1353)


Version 2.1.10-stable (2015-01-13)
----------------------------------

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 @@ -36,7 +36,7 @@ class Isotope extends \Controller
/**
* Isotope version
*/
const VERSION = '2.1.10';
const VERSION = '2.1.11';

/**
* True if the system has been initialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function generateMainImage()
if (!empty($arrTemplates) && is_array($arrTemplates)) {
foreach ($arrTemplates as $strTemplate) {
$objScript = new \Isotope\Template($strTemplate);
$strScripts = $objScript->parse();
$strScripts .= $objScript->parse();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function getPrice(IsotopeProductCollection $objCollection = null)
public function getMinimumQuantity()
{
// Minimum quantity is only available for advanced pricing
if (!$this->hasAdvancedPrices()) {
if (!$this->hasAdvancedPrices() || null === $this->getPrice()) {
return 1;
}

Expand Down Expand Up @@ -884,6 +884,7 @@ public function setRow(array $arrData)
if ((
!in_array($attribute, $this->getAttributes())
&& !in_array($attribute, $this->getVariantAttributes())
&& isset($GLOBALS['TL_DCA']['tl_iso_product']['fields'][$attribute]['attributes']['legend'])
&& $GLOBALS['TL_DCA']['tl_iso_product']['fields'][$attribute]['attributes']['legend'] != ''
)
|| in_array($attribute, Attribute::getVariantOptionFields())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static function findForCollection(IsotopeProductCollection $objCollection
$arrTaxes = array();
$arrAddresses = array('billing' => $objCollection->getBillingAddress());

if ($objCollection->hasShipping()) {
if ($objCollection->requiresShipping()) {
$arrAddresses['shipping'] = $objCollection->getShippingAddress();
}

Expand Down Expand Up @@ -471,7 +471,7 @@ protected static function buildSurcharge($strClass, $strLabel, $objSource, Isoto
$fltPrice = $objSurcharge->total_price;
$arrAddresses = array('billing' => $objCollection->getBillingAddress());

if ($objCollection->hasShipping()) {
if ($objCollection->requiresShipping()) {
$arrAddresses['shipping'] = $objCollection->getShippingAddress();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,6 @@ public static function findByProductData(array $row, array $arrOptions = array()
return $objProduct->getRelated('type');
}

return static::findByPk($row['type']);
return static::findByPk($row['type'], $arrOptions);
}
}
4 changes: 2 additions & 2 deletions system/modules/isotope/library/Isotope/Model/TaxClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function calculatePrice($fltPrice, array $arrAddresses = null)
if (!is_array($arrAddresses)) {
$arrAddresses = array('billing' => Isotope::getCart()->getBillingAddress());

if (Isotope::getCart()->hasShipping()) {
if (Isotope::getCart()->requiresShipping()) {
$arrAddresses['shipping'] = Isotope::getCart()->getShippingAddress();
}
}
Expand Down Expand Up @@ -104,7 +104,7 @@ public function calculateGrossPrice($fltPrice, $arrAddresses = null)
if (!is_array($arrAddresses)) {
$arrAddresses = array('billing' => Isotope::getCart()->getBillingAddress());

if (Isotope::getCart()->hasShipping()) {
if (Isotope::getCart()->requiresShipping()) {
$arrAddresses['shipping'] = Isotope::getCart()->getShippingAddress();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,15 @@ public function generate()
$tree .= $this->renderGrouptree($id, -20, true);
}
} else {
// Breadcrumb menu
if ($this->Session->get('iso_products_gid')) {
$tree .= $this->renderGrouptree($this->Session->get('iso_products_gid'), -20);
} // Predefined node set (see #3563)
elseif (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'])) {
if (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'])) {
// Predefined node set (see contao/core#3563)

foreach ($this->eliminateNestedPages($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'], $this->strTable) as $node) {
$tree .= $this->renderGrouptree($node, -20);
}
} // Show all groups to admins
elseif ($this->User->isAdmin) {
} elseif ($this->User->isAdmin) {
// Show all groups to admins

$objGroup = \Database::getInstance()->execute("SELECT id FROM tl_iso_group WHERE pid=0 ORDER BY sorting");

while ($objGroup->next()) {
Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

$GLOBALS['TL_LANGUAGE'] = 'en';
$GLOBALS['TL_CONFIG']['displayErrors'] = true;
\System::loadLanguageFile('default');
\System::loadLanguageFile('default');
3 changes: 3 additions & 0 deletions system/modules/isotope/test/fixtures/travis/initconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

// Put your custom configuration here
3 changes: 3 additions & 0 deletions system/modules/isotope/test/fixtures/travis/langconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

// Put your custom configuration here
23 changes: 23 additions & 0 deletions system/modules/isotope/test/fixtures/travis/localconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

### INSTALL SCRIPT START ###
$GLOBALS['TL_CONFIG']['licenseAccepted'] = true;
$GLOBALS['TL_CONFIG']['dbDriver'] = 'MySQLi';
$GLOBALS['TL_CONFIG']['dbHost'] = '127.0.0.1';
$GLOBALS['TL_CONFIG']['dbUser'] = 'root';
$GLOBALS['TL_CONFIG']['dbPass'] = '';
$GLOBALS['TL_CONFIG']['dbDatabase'] = 'isotope_core_testsuite';
$GLOBALS['TL_CONFIG']['dbPconnect'] = false;
$GLOBALS['TL_CONFIG']['dbCharset'] = 'UTF8';
$GLOBALS['TL_CONFIG']['dbPort'] = 3306;
$GLOBALS['TL_CONFIG']['dbSocket'] = '';
$GLOBALS['TL_CONFIG']['adminEmail'] = '[email protected]';
$GLOBALS['TL_CONFIG']['displayErrors'] = true;
$GLOBALS['TL_CONFIG']['defaultUser'] = '';
$GLOBALS['TL_CONFIG']['defaultGroup'] = '';
$GLOBALS['TL_CONFIG']['maintenanceMode'] = false;
$GLOBALS['TL_CONFIG']['coreOnlyMode'] = false;
$GLOBALS['TL_CONFIG']['bypassCache'] = true;
$GLOBALS['TL_CONFIG']['disableRefererCheck'] = true;
$GLOBALS['TL_CONFIG']['disableIpCheck'] = true;
### INSTALL SCRIPT STOP ###
4 changes: 4 additions & 0 deletions system/modules/isotope/test/fixtures/travis/pathconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// Relative path to the installation
return'';
2 changes: 1 addition & 1 deletion system/modules/isotope/test/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@

class IsotopeTest extends \PHPUnit_Framework_TestCase
{
public function testConvertWeight()
{
$this->assertEquals(\Isotope\Isotope::convertWeight(2, 'kg', 'g'), 2000);
$this->assertEquals(\Isotope\Isotope::convertWeight(2, 'g', 'mg'), 2000);
$this->assertEquals(\Isotope\Isotope::convertWeight(2, 'kg', 'mg'), 2000000);
}

public function testRegexpPrice()
{
\Input::setPost('test_rgxp_price', 'foobar');
Expand Down Expand Up @@ -60,7 +53,7 @@ public function testRegexpPrice()
$objWidget->rgxp = 'price';
$objWidget->validate();

$this->assertTrue($objWidget->hasErrors());
$this->assertFalse($objWidget->hasErrors());
unset($objWidget);
}
}

0 comments on commit ff8255b

Please sign in to comment.