Skip to content

Commit bedaf87

Browse files
author
Matthew Garde
committed
Changes.
1 parent eff3adc commit bedaf87

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

Helper/SettingsData.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public function getAccountCode()
2929
);
3030
}
3131

32+
public function getModuleVersion()
33+
{
34+
return $this->_moduleList
35+
->getOne(self::MODULE_NAME)['setup_version'];
36+
}
37+
3238
public function getAccountToken()
3339
{
3440
$settings = $this->settingsDataFactory->create();

Model/ResourceModel/SettingsData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class SettingsData extends AbstractDb
88
{
99
protected function _construct()
1010
{
11-
$this->_init('pcapredict_tag_settingsdata','id');
11+
$this->_init('pcapredict_tag_settingsdata','pcapredict_tag_settingsdata_id');
1212
}
1313
}

Setup/InstallSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
1818
$setup->getTable('pcapredict_tag_settingsdata')
1919
)
2020
->addColumn(
21-
'id',
21+
'pcapredict_tag_settingsdata_id',
2222
Table::TYPE_INTEGER,
2323
null,
2424
[ 'identity' => true, 'nullable' => false, 'primary' => true, 'unsigned' => true ],

Setup/UpgradeData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
2727
{
2828
// Set the new module_version column with the current of the app.
2929
// Because we do not know what vesion they logged in under set to the last version will have to do.
30-
$setup->updateTableRow($tableName, 'id', $row['id'], 'module_version', $context->getVersion());
30+
$setup->updateTableRow($tableName, 'pcapredict_tag_settingsdata_id', $row['pcapredict_tag_settingsdata_id'], 'module_version', $context->getVersion());
3131
}
3232
}
3333
}

Setup/UpgradeSchema.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
2626
// Check if the table already exists
2727
if ($setup->getConnection()->isTableExists($tableName) == true) {
2828

29-
// Alter the id name, to long for no reason at the moment.
30-
$setup->getConnection()->changeColumn($tableName, 'pcapredict_tag_settingsdata_id', 'id',
31-
[
32-
'type' => Table::TYPE_INTEGER,
33-
'nullable' => false,
34-
'identity' => true,
35-
'primary' => true,
36-
'unsigned' => true
37-
], false);
38-
3929
// Remove any columns we don't need.
4030
$setup->getConnection()->dropColumn($tableName, 'update_time');
4131

view/adminhtml/templates/tag_settings_index_script.phtml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
/**
33
* @var $block \Magento\Backend\Block\Template
4-
* @var $context \Magento\Framework\Setup\ModuleContextInterface
4+
* @var $context \Magento\Framework\Module\ResourceInterface
55
*/
66

77
$pcaSettings = $this->helper('PCAPredict\Tag\Helper\SettingsData');
88
$pcaAccCode = $pcaSettings->getAccountCode();
99
$pcaToken = $pcaSettings->getAccountToken();
1010
$pcaCustomJSFront = $pcaSettings->getCustomJavaScriptFront();
1111
$pcaCustomJSBack = $pcaSettings->getCustomJavaScriptBack();
12-
12+
$moduleVersion = $pcaSettings->getModuleVersion();
1313
?>
1414

1515

@@ -93,7 +93,7 @@ $pcaCustomJSBack = $pcaSettings->getCustomJavaScriptBack();
9393
</div>
9494
</div>
9595

96-
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $context->getVersion(); ?></div>
96+
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $moduleVersion; ?></div>
9797
</fieldset>
9898
</form>
9999
</div>
@@ -149,7 +149,7 @@ $pcaCustomJSBack = $pcaSettings->getCustomJavaScriptBack();
149149
</div>
150150
<!-- Version of the app in the display. -->
151151
<div style="margin-top: 25px;" class="secure-container-footer">
152-
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $context->getVersion(); ?></div>
152+
<div style="float: right; margin-right: -40px; font-size: 10px;"><?php echo $moduleVersion; ?></div>
153153
</div>
154154
</fieldset>
155155
</form>
@@ -421,5 +421,4 @@ $pcaCustomJSBack = $pcaSettings->getCustomJavaScriptBack();
421421

422422

423423
</script>
424-
</div>
425-
424+
</div>

0 commit comments

Comments
 (0)