Skip to content

Commit

Permalink
Merge pull request #1618 from magento-engcom/2.2-develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests

#11704 [Backport 2.2-develop] Travis: surround variable TRAVIS_BRANCH with double-quotes instead of single-quotes by @adrian-martinez-interactiv4
#11673 [BACKPORT 2.2] [TASK] Removed Typo in Paypal TestCase didgit => digit by @lewisvoncken
#11675 MAGETWO-77672: in system.xml translate phrase not work, if comment starts from new line. by @nmalevanec
#11439 [Backport 2.2-develop] #11328 : app:config:dump adds extra space every time in multiline array value by @adrian-martinez-interactiv4
#11057 Fix first day of week in dob customer field by @joachimVT

Fixed Public Issues

#7591 PayPal module, "didgit" misspelling
#7767 in system.xml translate phrase not work
#11328 app:config:dump adds extra space every time in multiline array value
  • Loading branch information
Oleksii Korshenko authored Oct 24, 2017
2 parents 2cc846e + 656254d commit b78dacf
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 11 deletions.
16 changes: 15 additions & 1 deletion app/code/Magento/Customer/Block/Widget/Dob.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public function getFieldHtml()
'max_date' => '-1d',
'change_month' => 'true',
'change_year' => 'true',
'show_on' => 'both'
'show_on' => 'both',
'first_day' => $this->getFirstDay()
]);
return $this->dateElement->getHtml();
}
Expand Down Expand Up @@ -307,4 +308,17 @@ public function getMaxDateRange()
}
return null;
}

/**
* Return first day of the week
*
* @return int
*/
public function getFirstDay()
{
return (int)$this->_scopeConfig->getValue(
'general/locale/firstday',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<data name="isVaultPresent" xsi:type="boolean">false</data>
<data name="configData" xsi:type="string">payflowpro</data>
<data name="paymentInfo" xsi:type="array">
<item name="AVS Street Match" xsi:type="string">#Y: Yes. Matched Address and five-didgit ZIP</item>
<item name="AVS Street Match" xsi:type="string">#Y: Yes. Matched Address and five-digit ZIP</item>
</data>
<data name="status" xsi:type="string">Processing</data>
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
Expand Down Expand Up @@ -113,7 +113,7 @@
<data name="payment/method" xsi:type="string">payflowpro</data>
<data name="creditCard/dataset" xsi:type="string">visa_default</data>
<data name="paymentInfo" xsi:type="array">
<item name="AVS zip" xsi:type="string">#Y: Yes. Matched Address and five-didgit ZIP</item>
<item name="AVS zip" xsi:type="string">#Y: Yes. Matched Address and five-digit ZIP</item>
</data>
<data name="configData" xsi:type="string">payflowpro, payflowpro_use_avs_zip</data>
<data name="status" xsi:type="string">Processing</data>
Expand Down
2 changes: 1 addition & 1 deletion dev/travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ case $TEST_SUITE in
--output-file="$changed_files_ce" \
--base-path="$TRAVIS_BUILD_DIR" \
--repo='https://github.com/magento/magento2.git' \
--branch='$TRAVIS_BRANCH'
--branch="$TRAVIS_BRANCH"
cat "$changed_files_ce" | sed 's/^/ + including /'

cd ../../..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ class PhpFormatter implements FormatterInterface
public function format($data, array $comments = [])
{
if (!empty($comments) && is_array($data)) {
return "<?php\nreturn array (\n" . $this->formatData($data, $comments, ' ') . "\n);\n";
return "<?php\nreturn array (\n" . $this->formatData($data, $comments) . "\n);\n";
}
return "<?php\nreturn " . var_export($data, true) . ";\n";
}

/**
* Format supplied data
*
* @param $data
* @param $comments
* @param string[] $data
* @param string[] $comments
* @param string $prefix
* @return string
*/
protected function formatData($data, $comments, $prefix = '')
private function formatData($data, $comments = [], $prefix = ' ')
{
$elements = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class PhpFormatterTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider formatWithCommentDataProvider
* @param string|array $data
* @param array $comments
* @param string[] $data
* @param string[] $comments
* @param string $expectedResult
*/
public function testFormat($data, $comments, $expectedResult)
Expand Down
2 changes: 2 additions & 0 deletions lib/internal/Magento/Framework/View/Element/Html/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ protected function _toHtml()
$changeYear = $this->getChangeYear();
$maxDate = $this->getMaxDate();
$showOn = $this->getShowOn();
$firstDay = $this->getFirstDay();

$html .= '<script type="text/javascript">
require(["jquery", "mage/calendar"], function($){
Expand Down Expand Up @@ -59,6 +60,7 @@ protected function _toHtml()
($changeMonth === null ? '' : ', changeMonth: ' . $changeMonth) .
($changeYear === null ? '' : ', changeYear: ' . $changeYear) .
($showOn ? ', showOn: "' . $showOn . '"' : '') .
($firstDay ? ', firstDay: ' . $firstDay : '') .
'})
});
</script>';
Expand Down
2 changes: 1 addition & 1 deletion setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function parseTranslatableNodes(\SimpleXMLElement $attributes, \SimpleXM
{
$nodesDelimiter = strpos($attributes['translate'], ' ') === false ? ',' : ' ';
foreach (explode($nodesDelimiter, $attributes['translate']) as $value) {
$phrase = (string)$element->{$value};
$phrase = trim((string)$element->{$value});
if ($phrase) {
$this->_addPhrase($phrase);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function parseDataProvider()
['phrase' => 'Phrase 2', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Phrase 3', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Phrase 1', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Comment from new line.', 'file' => $default, 'line' => '', 'quote' => ''],
],
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
<node2>
<title translate="true">Phrase 1</title>
</node2>
<node3 translate="comment">
<comment>
<![CDATA[Comment from new line.]]>
</comment>
</node3>
</layout>

0 comments on commit b78dacf

Please sign in to comment.