1

Any module you distribute must be licensed under the GPL 2.0 or later. You are free to put it up for sale so long as anyone who buys it enjoys the same rights of redistribution - that's just the nature of Drupal's license overall. Anyone who buys your module will be free to put it up on drupal.org and redistribute it at will.


1

Try this: use Drupal\commerce_payment\Entity\Payment; $payments = \Drupal::entityQuery('commerce_payment') ->condition('order_id', $order->id()) ->execute(); foreach ($payments as $value) { $payment = Payment::load($value); $payment->setState('completed')->save(); }


1

In Drupal 7, you can use the form_state_values_clean() function that removes: form_id form_token form_build_id op Usage example: <?php /** * Let's say this is your form. */ function your_form($form, &$form_state) { // Form items go here. // Let's add the form actions element... $form['actions'] = array( '#type' => 'actions', ); ...


Only top voted, non community-wiki answers of a minimum length are eligible