Skip to content

[Forwardport] Ensure integer values are not quoted as strings #18961

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

Closed
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -2021,11 +2021,7 @@ protected function _applyProductLimitations()
$this->getConnection()->quoteInto('cat_index.store_id=?', $filters['store_id'], 'int'),
];
if (isset($filters['visibility']) && !isset($filters['store_table'])) {
$conditions[] = $this->getConnection()->quoteInto(
Copy link
Contributor

@DanielRuf DanielRuf Nov 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not reverted here, please use the more readable version with multiple lines

'cat_index.visibility IN(?)',
$filters['visibility'],
'int'
);
$conditions[] = $this->getConnection()->quoteInto('cat_index.visibility IN(?)', $filters['visibility'], 'int');
}
$conditions[] = $this->getConnection()->quoteInto('cat_index.category_id=?', $filters['category_id'], 'int');
if (isset($filters['category_is_anchor'])) {
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/Magento/Framework/Mview/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ public function update()
? $this->changelogBatchSize[$this->getChangelog()->getViewId()]
: self::DEFAULT_BATCH_SIZE;

for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) {
for ($versionFrom = $lastVersionId; $versionFrom < $currentVersionId; $versionFrom += $versionBatchSize) {
// Don't go past the current version for atomicy.
$versionTo = min($currentVersionId, $vsFrom + $versionBatchSize);
$ids = array_map('intval', $this->getChangelog()->getList($vsFrom, $versionTo));
$versionTo = min($currentVersionId, $versionFrom + $versionBatchSize);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like $versionFrom is not defined there. Please fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ids = array_map('intval', $this->getChangelog()->getList($versionFrom, $versionTo));

// We run the actual indexer in batches.
// Chunked AFTER loading to avoid duplicates in separate chunks.
Expand Down