Skip to content

Commit bcf429f

Browse files
committed
MC-33856: Stabilize Integration Tests
1 parent f9ded1d commit bcf429f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app/code/Magento/Captcha/Model/DefaultModel.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,17 @@ public function getWord()
496496
/**
497497
* Get captcha words
498498
*
499-
* @return string|null
499+
* @return string
500500
*/
501501
private function getWords()
502502
{
503503
$sessionData = $this->session->getData($this->getFormIdKey(self::SESSION_WORD));
504-
return time() < $sessionData['expires'] ? $sessionData['words'] : null;
504+
$words = '';
505+
if (isset($sessionData['expires'], $sessionData['words']) && time() < $sessionData['expires']) {
506+
$words = $sessionData['words'];
507+
}
508+
509+
return $words;
505510
}
506511

507512
/**

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ public function execute()
194194
$attributeCode = $model && $model->getId()
195195
? $model->getAttributeCode()
196196
: $this->getRequest()->getParam('attribute_code');
197-
$attributeCode = $attributeCode ?: $this->generateCode($this->getRequest()->getParam('frontend_label')[0]);
197+
if (!$attributeCode) {
198+
$frontendLabel = $this->getRequest()->getParam('frontend_label')[0] ?? '';
199+
$attributeCode = $this->generateCode($frontendLabel);
200+
}
198201
$data['attribute_code'] = $attributeCode;
199202

200203
//validate frontend_input

0 commit comments

Comments
 (0)