Skip to content

Commit

Permalink
Merge pull request #118 in PLUG_OPEN/swagpaymentpaypalunified from pt…
Browse files Browse the repository at this point in the history
…-9189/5.2/migrate-legacy-payment-methods to master

* commit 'fd118432b02c208016babcc6418a73d55a3b2f13':
  NTR - Fix date column in the transaction list
  PT-9189 - Migrate legacy payments
  • Loading branch information
mitelg committed May 11, 2018
2 parents 718fdc0 + fd11843 commit bc3bb50
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Ext.define('Shopware.apps.PaypalUnified.view.overview.Grid', {
return value;
}

return Ext.util.Format.date(value) + ' ' + Ext.util.Format.date(value);
return Ext.util.Format.date(value, 'm.d.Y H:i');
},

/**
Expand Down
7 changes: 7 additions & 0 deletions Setup/Assets/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Resets the plugin Ids of the legacy payment methods
-- If not doing that, the legacy mode would not work
-- anymore after completely deleting the plugin through the plugin manager.
UPDATE s_core_paymentmeans AS payment
SET payment.pluginID = NULL
WHERE payment.name='paypal'
OR payment.name='payment_paypal_installments';
8 changes: 8 additions & 0 deletions Setup/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function install()
$this->createInstallmentsPaymentMethod();
$this->createAttributes();
$this->createDocumentTemplates();
$this->migrate();

return true;
}
Expand Down Expand Up @@ -195,6 +196,13 @@ private function removeDocumentTemplates()
$this->connection->exec($sql);
}

private function migrate()
{
$sql = file_get_contents($this->bootstrapPath . '/Setup/Assets/migration.sql');

$this->connection->query($sql);
}

/**
* @return string
*/
Expand Down

0 comments on commit bc3bb50

Please sign in to comment.