Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap Generation - Product URL check null fix #21749

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/code/Magento/Sitemap/Model/ResourceModel/Catalog/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
namespace Magento\Sitemap\Model\ResourceModel\Catalog;

use Magento\Catalog\Helper\Product as HelperProduct;
use Magento\Catalog\Model\Product\Image\UrlBuilder;
use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator;
use Magento\Store\Model\Store;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Model\ScopeInterface;
use Magento\Catalog\Helper\Product as HelperProduct;
use Magento\Store\Model\Store;

/**
* Sitemap resource product collection model
Expand Down Expand Up @@ -259,7 +259,7 @@ protected function _joinAttribute($storeId, $attributeCode, $column = null)
// Add attribute value to result set if needed
if (isset($column)) {
$this->_select->columns([
$column => $columnValue
$column => $columnValue
]);
}
}
Expand All @@ -282,7 +282,7 @@ protected function _getAttribute($attributeCode)
'attribute_id' => $attribute->getId(),
'table' => $attribute->getBackend()->getTable(),
'is_global' => $attribute->getIsGlobal() ==
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
'backend_type' => $attribute->getBackendType(),
];
}
Expand Down Expand Up @@ -324,7 +324,8 @@ public function getCollection($storeId)
[]
)->joinLeft(
['url_rewrite' => $this->getTable('url_rewrite')],
'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 AND url_rewrite.metadata IS '
'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 '
. 'AND NULLIF(url_rewrite.metadata,"") IS '
. $urlsConfigCondition . 'NULL'
. $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
. $connection->quoteInto(' AND url_rewrite.entity_type = ?', ProductUrlRewriteGenerator::ENTITY_TYPE),
Expand Down