Skip to content

Commit

Permalink
Merge branch 'hotfix/2.6.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Apr 2, 2020
2 parents ba2aaa0 + edcee6f commit 38b4c2a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
16 changes: 9 additions & 7 deletions system/modules/isotope/dca/tl_page.php
Expand Up @@ -23,15 +23,17 @@
/**
* Extend tl_page palettes
*/
\Haste\Dca\PaletteManipulator::create()
->addLegend('isotope_legend', 'publish_legen', \Haste\Dca\PaletteManipulator::POSITION_BEFORE)
->addField('iso_config', 'isotope_legend', \Haste\Dca\PaletteManipulator::POSITION_APPEND)
->addField('iso_store_id', 'isotope_legend', \Haste\Dca\PaletteManipulator::POSITION_APPEND)
->applyToPalette('root', 'tl_page')
;
try {
\Haste\Dca\PaletteManipulator::create()
->addLegend('isotope_legend', 'publish_legend', \Haste\Dca\PaletteManipulator::POSITION_BEFORE)
->addField('iso_config', 'isotope_legend', \Haste\Dca\PaletteManipulator::POSITION_APPEND)
->addField('iso_store_id', 'isotope_legend', \Haste\Dca\PaletteManipulator::POSITION_APPEND)
->applyToPalette('root', 'tl_page')
->applyToPalette('rootfallback', 'tl_page');
} catch (\InvalidArgumentException $e) {}

\Haste\Dca\PaletteManipulator::create()
->addLegend('isotope_legend', 'publish_legen', \Haste\Dca\PaletteManipulator::POSITION_BEFORE)
->addLegend('isotope_legend', 'publish_legend', \Haste\Dca\PaletteManipulator::POSITION_BEFORE)
->addField('iso_setReaderJumpTo', 'isotope_legend', \Haste\Dca\PaletteManipulator::POSITION_APPEND)
->applyToPalette('regular', 'tl_page')
;
Expand Down
8 changes: 8 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.6.md
@@ -1,6 +1,14 @@
Isotope eCommerce Changelog
===========================

Version 2.6.10 (2020-04-02)
--------------------------

- Correctly add item to breadcrumb on reader pages (#2083)
- Support new rootfallback palette in Contao 4.9 (#2121)
- Set constant FE_USER_LOGGED_IN in postsale entry point (#2122)


Version 2.6.9 (2020-03-11)
--------------------------

Expand Down
27 changes: 19 additions & 8 deletions system/modules/isotope/library/Isotope/Frontend.php
Expand Up @@ -528,7 +528,8 @@ public function addProductToBreadcrumb($arrItems)
/** @var \PageModel $objPage */
global $objPage;

if (!($objPage instanceof \PageRegular)
if ($objPage->type === 'error_404'
|| $objPage->type === 'error_403'
|| !($alias = Input::getAutoItem('product', false, true))
|| ($objProduct = Product::findAvailableByIdOrAlias($alias)) === null
) {
Expand All @@ -538,20 +539,30 @@ public function addProductToBreadcrumb($arrItems)
global $objIsotopeListPage;
$last = \count($arrItems) - 1;

// If we have a reader page, rename the last item (the reader) to the product title
if (null !== $objIsotopeListPage) {
// If we have a reader page that is a level below the list, rename the last item (the reader) to the product title
if (null !== $objIsotopeListPage && $objPage->pid == $objIsotopeListPage->id) {
$arrItems[$last]['title'] = $this->prepareMetaDescription($objProduct->meta_title ? : $objProduct->name);
$arrItems[$last]['link'] = $objProduct->name;
} // Otherwise we add a new item for the product at the last position
else {
$arrItems[$last]['href'] = \Controller::generateFrontendUrl($arrItems[$last]['data']);
$arrItems[$last]['isActive'] = false;
} else {
$listPage = $objIsotopeListPage ?: $objPage;

// Replace the current page (if breadcrumb is insert tag, it would already be the product name)
$arrItems[$last] = array(
'isRoot' => false,
'isActive' => false,
'href' => $listPage->getFrontendUrl(),
'title' => specialchars($listPage->pageTitle ?: $listPage->title),
'link' => $listPage->title,
'data' => $listPage->row(),
'class' => ''
);

// Add a new item for the current product
$arrItems[] = array(
'isRoot' => false,
'isActive' => true,
'href' => $objProduct->generateUrl($objPage),
'title' => $this->prepareMetaDescription($objProduct->meta_title ? : $objProduct->name),
'title' => specialchars($this->prepareMetaDescription($objProduct->meta_title ? : $objProduct->name)),
'link' => $objProduct->name,
'data' => $objPage->row(),
);
Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/library/Isotope/Isotope.php
Expand Up @@ -44,7 +44,7 @@ class Isotope extends \Controller
/**
* Isotope version
*/
const VERSION = '2.6.9';
const VERSION = '2.6.10';

/**
* True if the system has been initialized
Expand Down
4 changes: 4 additions & 0 deletions system/modules/isotope/postsale.php
Expand Up @@ -52,6 +52,10 @@ class PostSale extends \Frontend
public function __construct()
{
parent::__construct();

if (!\defined('FE_USER_LOGGED_IN')) {
\define('FE_USER_LOGGED_IN', false);
}

$this->removeUnsupportedHooks();

Expand Down

0 comments on commit 38b4c2a

Please sign in to comment.