Skip to content

Commit

Permalink
Merge pull request #77 from bitExpert/fix/74_bc_setup
Browse files Browse the repository at this point in the history
#74 Provides backwards compatibility by set strategy for existing rul…
  • Loading branch information
websharp committed Jul 11, 2017
2 parents 7b80ab8 + 4755037 commit e51140e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- #74 Provides backwards compatibility by set strategy for existing rules to regex matcher instead of static
- #72 Fixes on class resolution

## 2.0.2
Expand Down
22 changes: 20 additions & 2 deletions Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
$this->runUpgrade201($setup);
}

if (version_compare($context->getVersion(), '2.1.0', '<')) {
$this->runUpgrade210($setup);
}

$setup->endSetup();
}

Expand Down Expand Up @@ -152,24 +156,38 @@ protected function runUpgrade201(ModuleDataSetupInterface $setup)
);
}

/**
* @param ModuleDataSetupInterface $setup
*/
protected function runUpgrade210(ModuleDataSetupInterface $setup)
{
$setup->getConnection()->update(
$setup->getTable('bitexpert_forcelogin_whitelist'),
['strategy' => 'regex-all']
);
}

/**
* @param int $storeId
* @param string $label
* @param string $urlRule
* @param boolean $editable
* @param string $strategy
* @return array
*/
protected function getWhitelistEntryAsArray(
$storeId,
$label,
$urlRule,
$editable = false
$editable = false,
$strategy = 'default'
) {
return array(
'store_id' => $storeId,
'label' => $label,
'url_rule' => $urlRule,
'editable' => $editable
'editable' => $editable,
'strategy' => $strategy
);
}
}

0 comments on commit e51140e

Please sign in to comment.