Skip to content

Commit e918d3b

Browse files
committed
Fix the error that is wrong link title of a downloadable product when enabling "Use Default Value"
- Fix static code
1 parent 7962557 commit e918d3b

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

app/code/Magento/Downloadable/Model/Link/Builder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
/**
1515
* Class Builder
16+
*
17+
* @package Magento\Downloadable\Model\Link
1618
* @api
1719
* @since 100.1.0
1820
*/
@@ -134,7 +136,7 @@ public function build(\Magento\Downloadable\Api\Data\LinkInterface $link)
134136
}
135137

136138
$useDefaultTitle = $this->data['use_default_title'] ?? false;
137-
139+
138140
if ($useDefaultTitle) {
139141
$link->setTitle(null);
140142
}

app/code/Magento/Downloadable/Model/Sample/Builder.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
/**
1717
* Class Builder
18+
*
19+
* @package Magento\Downloadable\Model\Sample
1820
* @api
1921
* @since 100.1.0
2022
*/
@@ -71,6 +73,8 @@ public function __construct(
7173
}
7274

7375
/**
76+
* Init data for builder
77+
*
7478
* @param array $data
7579
* @return $this;
7680
* @since 100.1.0
@@ -82,6 +86,8 @@ public function setData(array $data)
8286
}
8387

8488
/**
89+
* Build sample link
90+
*
8591
* @param SampleInterface $sample
8692
* @return SampleInterface
8793
* @throws \Magento\Framework\Exception\LocalizedException
@@ -122,6 +128,8 @@ public function build(SampleInterface $sample)
122128
}
123129

124130
/**
131+
* Reset data
132+
*
125133
* @return void
126134
*/
127135
private function resetData()
@@ -130,6 +138,8 @@ private function resetData()
130138
}
131139

132140
/**
141+
* Get component
142+
*
133143
* @return Sample
134144
*/
135145
private function getComponent()

app/code/Magento/Downloadable/Test/Unit/Model/Link/BuilderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Class BuilderTest
15+
*
16+
* @package Magento\Downloadable\Test\Unit\Model\Link
1517
*/
1618
class BuilderTest extends \PHPUnit\Framework\TestCase
1719
{

app/code/Magento/Downloadable/Test/Unit/Model/Sample/BuilderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Class BuilderTest
15+
*
16+
* @package Magento\Downloadable\Test\Unit\Model\Sample
1517
*/
1618
class BuilderTest extends \PHPUnit\Framework\TestCase
1719
{

0 commit comments

Comments
 (0)