Skip to content

Commit 4714fd6

Browse files
committed
Merge remote-tracking branch 'origin/maintenance/2.0' into fix/BAP-13919_m2
2 parents b275ffd + 76c8d6c commit 4714fd6

File tree

14 files changed

+254
-47
lines changed

14 files changed

+254
-47
lines changed

src/Oro/Bundle/ConfigBundle/Config/UserScopeManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function getScopeEntityIdValue($entity)
7676
*/
7777
protected function ensureScopeIdInitialized()
7878
{
79-
if (null === $this->scopeId) {
79+
if (!$this->scopeId) {
8080
$scopeId = 0;
8181

8282
$token = $this->securityContext->getToken();

src/Oro/Bundle/InstallerBundle/Command/InstallCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,13 @@ protected function loadDataStep(CommandExecutor $commandExecutor, OutputInterfac
461461
]
462462
)
463463
->runCommand(
464-
'oro:workflow:definitions:load',
464+
'oro:cron:definitions:load',
465465
[
466466
'--process-isolation' => true
467467
]
468468
)
469469
->runCommand(
470-
'oro:cron:definitions:load',
470+
'oro:workflow:definitions:load',
471471
[
472472
'--process-isolation' => true
473473
]

src/Oro/Bundle/InstallerBundle/Command/PlatformUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
7070
]
7171
)
7272
->runCommand(LoadPermissionConfigurationCommand::NAME, ['--process-isolation' => true])
73-
->runCommand(
74-
'oro:workflow:definitions:load',
75-
['--process-isolation' => true]
76-
)
7773
->runCommand(
7874
'oro:cron:definitions:load',
7975
[
8076
'--process-isolation' => true
8177
]
8278
)
79+
->runCommand(
80+
'oro:workflow:definitions:load',
81+
['--process-isolation' => true]
82+
)
8383
->runCommand('oro:process:configuration:load', ['--process-isolation' => true])
8484
->runCommand('oro:migration:data:load', ['--process-isolation' => true])
8585
->runCommand('oro:navigation:init', ['--process-isolation' => true])

src/Oro/Bundle/InstallerBundle/Resources/views/Process/Step/schema.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% if dropDatabase %}
77
{% set steps = steps|merge(['schema-drop', 'clear-config', 'clear-extend']) %}
88
{% endif %}
9-
{% set steps = steps|merge(['schema-update', 'permissions', 'workflows', 'crons', 'processes', 'fixtures']) %}
9+
{% set steps = steps|merge(['schema-update', 'permissions', 'crons', 'workflows', 'processes', 'fixtures']) %}
1010

1111
{% block title %}{{ 'process.step.schema.header'|trans }} - {{ parent() }}{% endblock %}
1212

src/Oro/Bundle/MessageQueueBundle/Tests/Functional/Consumption/Dbal/Extension/RedeliverOrphanMessagesDbalExtensionTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use Oro\Component\MessageQueue\Consumption\Context;
77
use Oro\Component\MessageQueue\Consumption\Dbal\Extension\RedeliverOrphanMessagesDbalExtension;
88
use Oro\Component\MessageQueue\Test\DbalSchemaExtensionTrait;
9+
use Oro\Component\MessageQueue\Transport\Dbal\DbalDestination;
10+
use Oro\Component\MessageQueue\Transport\Dbal\DbalMessageConsumer;
911
use Psr\Log\NullLogger;
1012

1113
class RedeliverOrphanMessagesDbalExtensionTest extends WebTestCase
@@ -35,8 +37,15 @@ public function testShouldRedeliverOrphanMessages()
3537
$connection = $this->createConnection('message_queue');
3638
$dbal = $connection->getDBALConnection();
3739

40+
// test
41+
$session = $connection->createSession();
42+
$context = new Context($session);
43+
$context->setLogger(new NullLogger());
44+
$consumer = new DbalMessageConsumer($session, new DbalDestination('default'));
45+
$context->setMessageConsumer($consumer);
46+
3847
$dbal->insert('message_queue', [
39-
'consumer_id' => 'consumer-id',
48+
'consumer_id' => $consumer->getId(),
4049
'delivered_at' => strtotime('-1 year'),
4150
'redelivered' => false,
4251
'queue' => 'queue',
@@ -47,10 +56,6 @@ public function testShouldRedeliverOrphanMessages()
4756
//guard
4857
$this->assertGreaterThan(0, $id);
4958

50-
// test
51-
$context = new Context($connection->createSession());
52-
$context->setLogger(new NullLogger());
53-
5459
$extension = new RedeliverOrphanMessagesDbalExtension();
5560
$extension->onBeforeReceive($context);
5661

src/Oro/Bundle/TestFrameworkBundle/Resources/doc/reference/behat-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ Feature: User login
246246
247247
Scenario: Success login
248248
Given I am on "/user/login"
249-
When I fill "Login" form with:
249+
When I fill "Login Form" with:
250250
| Username | admin |
251251
| Password | admin |
252252
And I press "Log in"
253253
Then I should be on "/"
254254
255255
Scenario Outline: Fail login
256256
Given I am on "/user/login"
257-
When I fill "Login" form with:
257+
When I fill "Login Form" with:
258258
| Username | <login> |
259259
| Password | <password> |
260260
And I press "Log in"

src/Oro/Bundle/UserBundle/Resources/config/oro/behat.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ elements:
2727
selector: "form[id^='oro_user_role_form']"
2828
class: Oro\Bundle\UserBundle\Tests\Behat\Element\UserRoleForm
2929

30+
User Config Form:
31+
selector: 'form[name="look_and_feel"]'
32+
class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
33+
options:
34+
mapping:
35+
Use parent scope for Position: 'look_and_feel[oro_ui___navbar_position][use_parent_scope_value]'
36+
37+
Sided Main Menu:
38+
selector: 'div.main-menu-sided'
39+
class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Element
40+
3041
pages:
3142
Login:
3243
class: Oro\Bundle\UserBundle\Tests\Behat\Page\Login

src/Oro/Bundle/UserBundle/Tests/Behat/Features/user-configuration.feature

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Feature: User configuration
99
And I go to System/User Management/Users
1010
And I click Configuration on admin in grid "Grid"
1111
And I click "Display settings"
12-
And I uncheck "look_and_feel[oro_ui___navbar_position][use_parent_scope_value]"
13-
And I select "Left" from "Position"
12+
And I fill "User Config Form" with:
13+
| Use parent scope for Position | false |
14+
| Position | Left |
1415
When I press "Save settings"
15-
Then I should see 1 "div.main-menu-sided" elements
16+
Then I should see a "Sided Main Menu" element

src/Oro/Component/MessageQueue/Consumption/Dbal/Extension/RedeliverOrphanMessagesDbalExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,20 @@ public function onBeforeReceive(Context $context)
5151

5252
$sql = sprintf(
5353
'UPDATE %s SET consumer_id=NULL, delivered_at=NULL, redelivered=:isRedelivered '.
54-
'WHERE delivered_at <= :deliveredAt',
54+
'WHERE delivered_at <= :deliveredAt AND consumer_id=:consumerId',
5555
$connection->getTableName()
5656
);
57-
5857
$affectedRows = $dbal->executeUpdate(
5958
$sql,
6059
[
6160
'isRedelivered' => true,
6261
'deliveredAt' => time() - $this->orphanTime,
62+
'consumerId' => $context->getMessageConsumer()->getId(),
6363
],
6464
[
6565
'isRedelivered' => Type::BOOLEAN,
6666
'deliveredAt' => Type::INTEGER,
67+
'consumerId' => Type::STRING,
6768
]
6869
);
6970

src/Oro/Component/MessageQueue/Consumption/Dbal/Extension/RejectMessageOnExceptionDbalExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public function onInterrupted(Context $context)
2222
$context->getMessageConsumer()->reject($context->getMessage(), true);
2323

2424
$context->getLogger()->debug(
25-
'[RejectMessageOnExceptionDbalExtension] Execution was interrupted and message was rejected'
25+
'[RejectMessageOnExceptionDbalExtension] Execution was interrupted and message was rejected. {id}',
26+
['id' => $context->getMessage()->getMessageId()]
2627
);
2728
}
2829
}

0 commit comments

Comments
 (0)