Skip to content

Commit d6d9376

Browse files
committed
MAGETWO-57165: [Backport] 'Add Products Manually' link is not available after removing all variations #2703 - for 2.0
1 parent bbf153e commit d6d9376

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

app/code/Magento/Eav/Model/AttributeRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getList($entityTypeCode, \Magento\Framework\Api\SearchCriteriaIn
103103
'main_table.entity_type_id = entity_type.entity_type_id',
104104
[]
105105
);
106-
$attributeCollection->join(
106+
$attributeCollection->joinLeft(
107107
['eav_entity_attribute' => $attributeCollection->getTable('eav_entity_attribute')],
108108
'main_table.attribute_id = eav_entity_attribute.attribute_id',
109109
[]

lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,33 @@ public function join($table, $cond, $cols = '*')
520520
return $this;
521521
}
522522

523+
/**
524+
* Join table to collection select
525+
*
526+
* @param string $table
527+
* @param string $cond
528+
* @param string $cols
529+
* @return $this
530+
*/
531+
public function joinLeft($table, $cond, $cols = '*')
532+
{
533+
if (is_array($table)) {
534+
foreach ($table as $k => $v) {
535+
$alias = $k;
536+
$table = $v;
537+
break;
538+
}
539+
} else {
540+
$alias = $table;
541+
}
542+
543+
if (!isset($this->_joinedTables[$alias])) {
544+
$this->getSelect()->joinLeft([$alias => $this->getTable($table)], $cond, $cols);
545+
$this->_joinedTables[$alias] = true;
546+
}
547+
return $this;
548+
}
549+
523550
/**
524551
* Redeclare before load method for adding event
525552
*

0 commit comments

Comments
 (0)