Skip to content

Commit

Permalink
1.10.0_RC3
Browse files Browse the repository at this point in the history
  • Loading branch information
justin7griffin committed Sep 22, 2023
1 parent 6075d9e commit 7590138
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Model/Queue/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,17 @@ protected function applyTranslationCmsBlock()

if ($needNewEntity) {
$newEntity = $this->blockFactory->create();
$newEntity->setTitle($oldEntity->getTitle());
$newEntity->addData($translatedData['attributes']);
$newEntity->setStoreId($targetStoreId);
if (!array_key_exists('content', $translatedData['attributes'])) {
$newEntity->setContent($oldEntity->getContent());
}
if (!array_key_exists('title', $translatedData['attributes'])) {
$newEntity->setTitle($oldEntity->getTitle());
}
if (!array_key_exists('identifier', $translatedData['attributes'])) {
$newEntity->setIdentifier($oldEntity->getIdentifier());
}
$newEntity->setStoreId($targetStoreId);
$newEntity->setIsActive($oldEntity->getIsActive());
$newEntity->save();
$this->setData('new_entity_id', $newEntity->getBlockId());
Expand Down Expand Up @@ -924,7 +929,7 @@ protected function applyTranslationCmsPage()
$newEntity->setIdentifier($oldEntity->getIdentifier());
}
if (!array_key_exists('meta_title', $translatedData['attributes'])) {
$newEntity->setMetaTitle($oldEntity->getIdentifier());
$newEntity->setMetaTitle($oldEntity->getMetaTitle());
}
$newEntity->setPageLayout($oldEntity->getPageLayout());
$newEntity->setIsActive($oldEntity->getIsActive());
Expand Down
2 changes: 1 addition & 1 deletion Model/ResourceModel/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected function _findBanners($object)
foreach ($cmsPageCollection as $cmsPage) {
$bannerIDs = [];
$matches = [];
preg_match_all('/{{widget type="(.{0,100})"(.{0,150})banner_ids="(.{0,10})"(.{0,150})}}/', $cmsPage->getContent(), $matches);
preg_match_all('/{{widget type="(.{0,100})"(.{0,150})banner_ids="(.{0,100})" template="(.{0,150})}}/', $cmsPage->getContent(), $matches);
if (!empty($matches) && isset($matches[3])) {
$bannerIDs = array_unique($matches[3]);
foreach($bannerIDs as $bannerID){
Expand Down
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": "transperfect/module-globallink",
"type": "magento2-module",
"description": "TransPerfect GlobalLink",
"version": "1.10.0_RC2",
"version": "1.10.0_RC3",
"homepage": "http://www.translations.com/products/globallink-magento-adaptor",
"authors": [
{
Expand Down

0 comments on commit 7590138

Please sign in to comment.