Skip to content

Commit c2c56ab

Browse files
committed
METSUP:68: Fix url-conflict in import
1 parent ad12091 commit c2c56ab

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

src/Observers/UrlRewriteObserver.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,16 @@ protected function process()
318318
try {
319319
$this->urlRewriteId = $this->persistUrlRewrite($urlRewrite);
320320
} catch (\PDOException $pdoe) {
321-
$message = sprintf('%s with Urlrewrite Data %s "', $pdoe->getMessage(), $urlRewrite);
321+
$message = sprintf(
322+
'Is a PDO exception is thrown: with Urlrewrite Data \\n
323+
("entity_id": "%s" && "request_path": "%s" && "target_path": "%s" && "entity_type": "%s" && "redirect_type": "%s" && "store_id": "%s")',
324+
$urlRewriteProductCategory[MemberNames::ENTITY_ID],
325+
$urlRewriteProductCategory[MemberNames::REQUEST_PATH],
326+
$urlRewriteProductCategory[MemberNames::TARGET_PATH],
327+
$urlRewriteProductCategory[MemberNames::ENTITY_TYPE],
328+
$urlRewriteProductCategory[MemberNames::REDIRECT_TYPE],
329+
$urlRewriteProductCategory[MemberNames::STORE_ID]
330+
);
322331
if (!$this->getSubject()->isStrictMode()) {
323332
$this->getSubject()
324333
->getSystemLogger()
@@ -360,7 +369,16 @@ protected function process()
360369
try {
361370
$this->persistUrlRewriteProductCategory($urlRewriteProductCategory);
362371
} catch (\PDOException $pdoe) {
363-
$message = sprintf('%s with Urlrewrite Data %s "', $pdoe->getMessage(), $urlRewriteProductCategory);
372+
$message = sprintf(
373+
'Is a PDO exception is thrown: with Urlrewrite Data \\n
374+
("entity_id": "%s" && "request_path": "%s" && "target_path": "%s" && "entity_type": "%s" && "redirect_type": "%s" && "store_id": "%s")',
375+
$urlRewriteProductCategory[MemberNames::ENTITY_ID],
376+
$urlRewriteProductCategory[MemberNames::REQUEST_PATH],
377+
$urlRewriteProductCategory[MemberNames::TARGET_PATH],
378+
$urlRewriteProductCategory[MemberNames::ENTITY_TYPE],
379+
$urlRewriteProductCategory[MemberNames::REDIRECT_TYPE],
380+
$urlRewriteProductCategory[MemberNames::STORE_ID]
381+
);
364382
if (!$this->getSubject()->isStrictMode()) {
365383
$this->getSubject()
366384
->getSystemLogger()

src/Observers/UrlRewriteUpdateObserver.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,16 @@ protected function process()
135135
$this->persistUrlRewrite($existingUrlRewrite);
136136
} catch (\PDOException $pdoe) {
137137
if (!$this->getSubject()->isStrictMode()) {
138-
$message = sprintf('%s with Urlrewrite Data %s "', $pdoe->getMessage(), $existingUrlRewrite);
138+
$message = sprintf(
139+
'Is a PDO exception is thrown: with Urlrewrite Data \\n
140+
("entity_id": "%s" && "request_path": "%s" && "target_path": "%s" && "entity_type": "%s" && "redirect_type": "%s" && "store_id": "%s")',
141+
$existingUrlRewrite[MemberNames::ENTITY_ID],
142+
$existingUrlRewrite[MemberNames::REQUEST_PATH],
143+
$existingUrlRewrite[MemberNames::TARGET_PATH],
144+
$existingUrlRewrite[MemberNames::ENTITY_TYPE],
145+
$existingUrlRewrite[MemberNames::REDIRECT_TYPE],
146+
$existingUrlRewrite[MemberNames::STORE_ID]
147+
);
139148
$this->getSubject()
140149
->getSystemLogger()
141150
->warning($this->getSubject()->appendExceptionSuffix($message));

0 commit comments

Comments
 (0)