Commit 5a65a650 authored by bojanz's avatar bojanz

Fix the PaymentGateway plugin sort.

parent 647c03f4
......@@ -5,7 +5,6 @@ namespace Drupal\commerce_payment\Form;
use Drupal\commerce\Form\CommercePluginEntityFormBase;
use Drupal\commerce_payment\PaymentGatewayManager;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SortArray;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -47,7 +46,7 @@ class PaymentGatewayForm extends CommercePluginEntityFormBase {
$plugins = array_map(function ($definition) {
return $definition['label'];
}, $this->pluginManager->getDefinitions());
uasort($plugins, [SortArray::class, 'sortByTitleElement']);
// Use the first available plugin as the default value.
if (!$gateway->getPluginId()) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment