Skip to content

Commit

Permalink
Merge branch 'MAGETWO-44997' into MAGETWO-44074
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Slabko committed Dec 8, 2015
2 parents fa41dfd + bcd9365 commit 42f74cc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class Suffix extends \Magento\Framework\App\Config\Value
/** @var \Magento\Framework\DB\Adapter\AdapterInterface */
protected $connection;

/**
* @var \Magento\Framework\App\Resource
*/
protected $resource;

/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
Expand Down Expand Up @@ -67,6 +72,7 @@ public function __construct(
$this->connection = $appResource->getConnection();
$this->urlFinder = $urlFinder;
$this->storeManager = $storeManager;
$this->resource = $appResource;
}

/**
Expand Down Expand Up @@ -118,7 +124,7 @@ protected function updateSuffixForUrlRewrites()
? [UrlRewrite::REQUEST_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getRequestPath())]
: [UrlRewrite::TARGET_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getTargetPath())];
$this->connection->update(
DbStorage::TABLE_NAME,
$this->resource->getTableName(DbStorage::TABLE_NAME),
$bind,
$this->connection->quoteIdentifier(UrlRewrite::URL_REWRITE_ID) . ' = ' . $urlRewrite->getUrlRewriteId()
);
Expand Down

0 comments on commit 42f74cc

Please sign in to comment.