Skip to content

Commit eff3adc

Browse files
author
Matthew Garde
committed
WIP
1 parent 0c02e1a commit eff3adc

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

Setup/UpgradeData.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class UpgradeData implements UpgradeDataInterface {
1212
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context ) {
1313

1414
// Take all current records and set the current version of the app as the module_version.
15-
// Tidy up by taking either the row which has id 1 as this was what the old logic looked for.
16-
// If there is id=1 then simply keep the row with the latest creation time as this logic is what will
17-
// be used when checking for credentials, even though one record will still only be needed.
15+
// We will now fetch a record based on the last created time and not an id.
16+
// It was likely that with previous versions, if login/key setup failed at any point it would write a row but go back to the login screen,
17+
// thus subsquent attempts caused more rows to be written.
1818
if (version_compare($context->getVersion(), '2.0.7') < 0) {
1919

2020
$tableName = $setup->getTable('pcapredict_tag_settingsdata');
@@ -29,18 +29,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
2929
// Because we do not know what vesion they logged in under set to the last version will have to do.
3030
$setup->updateTableRow($tableName, 'id', $row['id'], 'module_version', $context->getVersion());
3131
}
32-
33-
$select = $setup->getConnection()->select()->from($tableName)->where('id = 1');
34-
35-
$row = $this->setup->getConnection()->fetchOne($select);
36-
37-
var_dump($row);
38-
39-
$select2 = $setup->getConnection()->select()->from($tableName)->where('id = 2');
40-
41-
$row2 = $this->setup->getConnection()->fetchOne($select2);
42-
43-
var_dump($row2);
4432
}
4533
}
4634
}

view/adminhtml/templates/tag_settings_index_script.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $pcaToken = $pcaSettings->getAccountToken();
1010
$pcaCustomJSFront = $pcaSettings->getCustomJavaScriptFront();
1111
$pcaCustomJSBack = $pcaSettings->getCustomJavaScriptBack();
1212

13-
$version = $context->getVersion();
1413
?>
1514

1615

@@ -94,7 +93,7 @@ $version = $context->getVersion();
9493
</div>
9594
</div>
9695

97-
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo strtoupper($version); ?></div>
96+
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $context->getVersion(); ?></div>
9897
</fieldset>
9998
</form>
10099
</div>
@@ -150,7 +149,7 @@ $version = $context->getVersion();
150149
</div>
151150
<!-- Version of the app in the display. -->
152151
<div style="margin-top: 25px;" class="secure-container-footer">
153-
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo strtoupper($version); ?></div>
152+
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $context->getVersion(); ?></div>
154153
</div>
155154
</fieldset>
156155
</form>

0 commit comments

Comments
 (0)