@@ -12,9 +12,9 @@ class UpgradeData implements UpgradeDataInterface {
12
12
public function upgrade (ModuleDataSetupInterface $ setup , ModuleContextInterface $ context ) {
13
13
14
14
// 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 .
18
18
if (version_compare ($ context ->getVersion (), '2.0.7 ' ) < 0 ) {
19
19
20
20
$ tableName = $ setup ->getTable ('pcapredict_tag_settingsdata ' );
@@ -29,18 +29,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
29
29
// Because we do not know what vesion they logged in under set to the last version will have to do.
30
30
$ setup ->updateTableRow ($ tableName , 'id ' , $ row ['id ' ], 'module_version ' , $ context ->getVersion ());
31
31
}
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 );
44
32
}
45
33
}
46
34
}
0 commit comments