Drupal Planet

Subscribe to Drupal Planet feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 5 hours 40 min ago

myDropWizard.com: Drupal 6 security update for CCK

April 18, 2017 - 3:05pm

As you may know, Drupal 6 has reached End-of-Life (EOL) which means the Drupal Security Team is no longer doing Security Advisories or working on security patches for Drupal 6 core or contrib modules - but the Drupal 6 LTS vendors are and we're one of them!

Today, there is a Moderately Critical security release for the CCK module to fix an Access Bypass vulnerability.

CCK allows you to add custom fields to any content type.

The Node Reference sub-module had a bug where it could list the node titles of nodes that the user doesn't have access to.

Here you can download the Drupal 6 patch.

If you have a Drupal 6 site using the CCK module, we recommend you update immediately! We have already deployed the patch for all of our Drupal 6 Long-Term Support clients. :-)

If you'd like all your Drupal 6 modules to receive security updates and have the fixes deployed the same day they're released, please check out our D6LTS plans.

Note: if you use the myDropWizard module (totally free!), you'll be alerted to these and any future security updates, and will be able to use drush to install them (even though they won't necessarily have a release on Drupal.org).

Categories: Blogs

Pantheon Blog: Building a Network of 195 Drupal 8 Sites Using Pantheon’s Upstream

April 18, 2017 - 3:04pm
Fairfax County Public Schools (FCPS) is the largest school system in Virginia and the 10th largest in the United States, with more than 200 schools and centers serving 186,000 students. To keep this large community of students, parents, teachers, employees, and the general public informed, FCPS is building out a network of 195 school websites.
Categories: Blogs

Drupal.org blog: What's new on Drupal.org? - March 2017

April 18, 2017 - 3:02pm

Read our Roadmap to understand how this work falls into priorities set by the Drupal Association with direction and collaboration from the Board and community.

The Drupal Association team is gearing up for DrupalCon Baltimore. We're excited to see you there and we'll presenting a panel giving an update on our work since Dublin, and our plans for the coming months.

Drupal.org updates Project application revamp

As we announced in mid-March, new contributors on Drupal.org can now create full projects and releases! Contributors no longer have to wait in the project application queue for a manual review before they are able to contribute projects.

This is a very significant change in the Drupal contribution landscape, and it's something we approached carefully and will continue to monitor over the coming months. Drupal has always had a reputation for a high quality code, and we want to make sure that reputation is preserved with good security signals, project quality signals, and continued incentives for peer code review.

That said, we're very excited to see how this change opens up Drupal to a wider audience of contributors.

Please note that the removal of project applications to create full projects and releases means a change in the security advisory policy (see below for details).

Security Advisory Opt-in and new Security Signals for Projects Are you responsible for the security of your clients' Drupal sites?

Please note that Drupal's security advisory coverage policy has changed. Security advisory coverage for contributed projects is now only available for projects that have both opted in to receive coverage and made a stable release. You can see which projects have opted in by checking their project pages. If you have questions, please contact security@drupal.org.

Because users may now create full projects and releases without opting in to security advisory coverage, it's critically important that we provide good security signals to users evaluating projects on Drupal.org. This is why we've added a security coverage warning to projects that aren't opted in to coverage.

We've also:

2017 Community Elections Update

The 2017 elections for the community-at-large seat on the board were held successfully in March. Drupal Association community board elections are conducted with the Instant Runoff Voting system. This voting methodology requires that voters rank their preferred candidates on their ballot, and we've heard that this system has been somewhat unwieldy in the past.

Each year we try to improve the voter experience and so this year we deployed a new drag-and-drop ballot.

Finally, we want to congratulate our newest board member Ryan Szrama!

Better international datetime support throughout Drupal.org

Drupal.org has grown organically over the course of more than a decade, and as features have been built out they were not always consistent in their display of datetime information. While it sometimes makes sense to have a few different formats for displaying date and time, many of the formats in use were simply arbitrary historical decisions.

As a quality of life improvement, especially for users outside of the USA, we've standardized the datetime format used on Drupal.org. That format is: DD MMM YYYY - hh:mm (UTC±h). For example: 11 Aug 2016 - 16:42 (UTC+8)

DrupalCI CSS Lint check style results

When we implemented coding standards testing in DrupalCI in February we were not able to add CSS Lint testing until the CSSLint configuration file in core was fixed. That issue was fixed in late February and so we added CSSLint to support coding standards testing for CSS at the beginning of March.

Cleaning up coding standards results

The addition of coding standards results to DrupalCI means that Drupal.org is now storing even more test data about the code we test on Drupal.org. Our initial implementation of coding standards testing did not include clean up of older results, and so to preserve database space and testing resources, we implemented some clean-up routines in March. In particular we are now:

  • Cleaning up all results for closed issues
  • For custom one-off tests, keeping results for 30 days to match what is shown on project’s automated testing tab
  • For tests triggered on a schedule or commit, keeping the most recent per-environment per-branch, and keeping anything less than 24h old
Infrastructure Protecting Git services

We experienced some minor Git outages in March, due to malicious authentication attempts. To mitigate these issues in the future, we've implemented fail2ban rules to protect Git authentication. This should improve the stability and uptime of Git services for all developers on Drupal.org.

We want to thank Drupal.org infrastructure volunteer mlhess for his assistance with this.

Community Initiatives Contrib Documentation Migration

New tools for Documentation have been available on Drupal.org for more than half a year. While most of the core documentation has been migrated to the new system, we are still encouraging Contrib maintainers to migrate their docs.

To make it easier for contrib project maintainers to migrate their documentation to the new documentation tools, we've made two improvements:

———

As always, we’d like to say thanks to all the volunteers who work with us, and to the Drupal Association Supporters, who made it possible for us to work on these projects. In particular we want to thank:

If you would like to support our work as an individual or an organization, consider becoming a member of the Drupal Association.

Follow us on Twitter for regular updates: @drupal_org, @drupal_infra

Categories: Blogs

Acquia Developer Center Blog: Getting Started with Acquia Cloud CD

April 18, 2017 - 2:19pm

The engineers at Acquia recently launched Acquia Cloud CD, a set of developer tools to automatically and continuously assure the quality of Drupal applications on Acquia Cloud.

To help you get started with these powerful tools, Acquia Learning Services has created a task-oriented, hands-on tutorial, to walk you through implementing continuous integration for your Drupal application.

Tags: acquia drupal planet
Categories: Blogs

DrupalCon News: Additional ways to participate in Drupal training

April 18, 2017 - 2:04pm

A week at DrupalCon is a fantastic way to level up your skills and bring new knowledge back to your work. We have had such high interest in these training courses, that many have sold out!  We know there are still people out there who want to learn these valuable skills, and we want to be sure you have that chance, even if it's not at DrupalCon. 

Categories: Blogs

Web Wash: How to Crop Images using Crop API, Image Widget Crop and Focal Point in Drupal 8

April 18, 2017 - 2:00pm
If you’ve done any Drupal site building, I’m sure you’ve experienced this issue. You create an image style with the “Scale and crop” effect and everything is going great until an editor uploads an image with a different aspect ratio. Now instead of images getting cropped correctly, they’re getting cut in half, or the top part is chopped off, and images are not displaying nicely. You could fix this problem by tweaking the image style to handle different aspect ratios, but it’ll never be the perfect solution. The best option is to crop image directly in Drupal, and this is what you’ll learn today. In this tutorial, you’ll learn how to avoid these situations by using Crop API. Now, Crop API doesn’t offer any interface on its own; it’s just an API. The two modules that provide an interface are Image Widget Crop and Focal Point. We’ll take a look at these modules in detail, in this tutorial.
Categories: Blogs

Mikkel Høgh: Why I care about the Drupal drama

April 18, 2017 - 1:23pm
Why I care about the Drupal drama

There’s been a lot said and written about the most recent drama in the Drupal community, quite a few people have asked me why I care. This is hard to answer without sounding flippant in 140 characters, so I’ve taken the time to write another blog post about the topic. This one a little less angry and more reasoned than the first.

mikl Tue, 2017-04-18 - 18:23 Tags Drupal Drupal Planet
Categories: Blogs

Xeno Media: Xeno Media’s Jim Birch presents on Bootstrap Paragraphs at Baltimore DrupalCon 2017

April 18, 2017 - 12:22pm

Attendees to Baltimore's DrupalCon 2017 should check out Xeno Media Strategist Jim Birch's presentation, Bootstrap Paragraphs, on April 26 at 10:45am.

In it, you will learn how to combine the power of the world's most popular front end framework, Bootstrap with Drupal Paragraphs, the powerful module that allows content creators to build layouts and structured pages.

Using the Bootstrap Paragraphs Drupal 8 module, you'll be able to create Bootstrap features like Accordions, Carousels, Modals, Tabs, and Multi-column layouts.  We'll also demonstrate how to harness the power of Drupal referencing Text, Images, Contact Forms, Blocks, and even Views!  We will also review how the module adds different widths and backgrounds which can be modified in the Drupal theme layer.

This presentation will review:
  • Why use the Bootstrap framework?
  • Why use the Paragraphs module?
  • What goes into the different types of bundles?
  • How we add width and background options
  • How to override, and build on top of the defaults
Learning Objectives & Outcomes:

Attendees will come away learning how to build a site using the Bootstrap Paragraphs module, how to customize it in their own themes, and how to use the module as a baseline to develop their own Paragraphs bundle types.

Categories: Blogs

Colorfield: Update a project installed via composer_manager or drush to a CI based Composer template under Drupal VM

April 18, 2017 - 7:24am
Update a project installed via composer_manager or drush to a CI based Composer template under Drupal VM christophe Tue, 18/04/2017 - 12:24

If you have to go for a Drupal core update from a previous install based on composer_manager or drush (both deprecated), consider installing something robust, Composer friendly, that also enables CI tools like Phing, Behat, PHPUnit, ...

If you don't have already Drupal VM installed, head to the documentation.

Categories: Blogs

Valuebound: How to Sync Blocks Between different environments in a Drupal 8 website

April 18, 2017 - 4:32am

A custom block is made of two entities, one for the placement and one for the actual content. Only the actual placement can be exported with cim. The content can not. Therefore this will result in "Block description Broken/Missing" error on site where the config is imported. And since there is no option to disable custom blocks from being exported through Configuration management, this will break the functionality.

Steps to reproduce

On Site A:

Create custom block

Assign this custom block to any region

Export configuration of the site

On Site B:

Import configuration from site A…

Categories: Blogs

Palantir: The Draven

April 17, 2017 - 2:09pm
The Draven brandt Mon, 04/17/2017 - 12:09 Allison Manley Apr 17, 2017

Let's connect at DrupalCon Baltimore, April 24 - 28, 2017.

In this post we will cover...
  • Sessions we'll be presenting at DrupalCon
  • A fun movie trailer for PM: The Musical!
  • An opportunity for you to sign up to meet with us

We want to speak with you at DrupalCon!

Schedule a Time

Heavily borrowing from “The Raven” by Baltimore’s own Edgar Allen Poe.


Once upon a laptop dreary, with its glow so blue and eerie,
Viewing travel sites where I could shop the online store —
While I purchased, looked at mapping, suddenly there came a tapping,
As of someone gently rapping, rapping at my office door.
“’Tis my colleague,” I muttered, “tapping at my office door —
Helping plan for Baltimore.”

DrupalCon! It is upon us! This conference of such colossus;
3,000 strong will be among us on the conference floor.
Many coming from Palantir to learn and join in Drupal’s cheer
Coming to learn and share with those of similar rapport,
Descending upon a convention center on this eastern shore.
Arriving to explore.

Palantir will have a presence: Booth 109 — and we’ll have presents:
Swag to give all those who visit our spot upon the floor.
A photo booth will offer chances to give our visitors some glances
Of how they look with props and hats of variety galore.
They can tweet and share photos beyond that building’s door.
Posterity forever more!

Three talks will come from Palantiri, who worked hard on each topic’s theory.
The first is 2:15 on Tuesday, and has a musical score:
“Project Management: The Musical” . . . could be slightly Seussical!
Allison and Joe will sing and dance on running scrums and more.
There’s much to learn! Don’t be fooled by the use of songs of yore.
Room 307 – Acquia in Baltimore.

The next are April 27. First at noon . . . is it hell or heaven?
Can separate teams together be something to desire or deplore?
“Successfully Integrating Teams” is the stuff of engineer dreams.
Mixing teams with thoughtful prep can much success ensure.
The tips to do this seamlessly Megh Plunkett will underscore.
Room 319 – Platform.sh in Baltimore.

The last is in the afternoon, and shows that no site is immune
From website content that has been continuously ignored.
“Content Before Code: A D8 Case Study” at 2:45. Grab a buddy!
So you too can learn how to gather content in ways to make all sure.
“Get your content ready for launch!” Michelle and Bec implore.
Room 307 – Acquia in Baltimore.

Palantir will host the fun at Trivia Night, where everyone
Can try for fame by answering questions about Core.
Doors will open right at 8, so hurry there and don’t be late!
Test your skills against your friends to gain the highest score.
Baltimore Soundstage is the place where we shall host the lore.
124 Market Place in Baltimore.

Our wish to see you there grows stronger; hesitating then no longer,
Please know we’d love to see you at our booth or on the floor.
Since we know that time can be fleeting, you can even set up a meeting.
To discuss how we can help your project take wing, and then to soar!
Contact us so we can meet that week in Baltimore.
DrupalCon forevermore!

We want to speak with you at DrupalCon!

Schedule a Time
Categories: Blogs

Chromatic: How to Avoid the DrupalFlu

April 17, 2017 - 10:15am

This year, don't take home the DrupalFlu along with your swag and business cards - here are some tips for staying healthy at a huge conference.

Categories: Blogs

Palantir: Project Management: The Musical! DrupalCon Trailer

April 14, 2017 - 5:10pm
Project Management: The Musical! DrupalCon Trailer brandt Fri, 04/14/2017 - 15:10 Alex Brandt Apr 14, 2017

Come see Project Management: The Musical! at DrupalCon Baltimore. April 25th at 2:15pm.

In this presentation we will cover...
  • How to get your project organized
  • What analytics and KPIs to review
  • How to handle scope creep
  • ...and many more facets of project management

We want to make your project a success.

Let's Chat.

Additional information about this session can be found on the DrupalCon site

 

 

Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter.
Categories: Blogs

Agaric Collective: Doing links on Drupal 8

April 14, 2017 - 4:19pm

There are plenty of ways to create links when using Drupal 8 and I will share some of those ways in this post.

The easiest way to create internal links is using Link::createFromRoute

And it is used like this:

use Drupal\Core\Link; $link = Link::createFromRoute('This is a link', 'entity.node.canonical', ['node' => 1]);

Using the Url object gives you more flexibility to create links, for instance, we can do the same as Link::createFromRoute method using the Url object like this:

use Drupal\Core\Link; use Drupal\Core\Url; $link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1]));

And actually Link::fromTextAndUrl is what Drupal recommends instead of using the deprecated l() method. Passing the Url object to the link object gives you great flexibility to create links, here are some examples:

Internal links which have no routes:

$link = Link::fromTextAndUrl('This is a link', Url::fromUri('base:robots.txt'));

External links:

$link = Link::fromTextAndUrl('This is a link', Url::fromUri('http://www.google.com'));

Using the data provided by a user:

$link = Link::fromTextAndUrl('This is a link', Url::fromUserInput('/node/1');

The param passed to fromUserInput must start with /,#,? or it will throw an exception.

Linking entities.

$link = Link::fromTextAndUrl('This is a link', Url::fromUri('entity:node/1'));

Entities are a special case, and there are more ways to link them:

$node = Node::load(1); $link = $node->toLink(); $link->setText('This is a link');

And even using the route:

$link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1]));

Drupal usually expects a render array if you are going to print the link, so the Link object has a method for that:

$link->toRenderable();

which will return an array.

Final tips:

Searching a route using Drupal Console

The easiest way to find the route of a specific path is using Drupal Console, with the following command.

$ drupal router:debug | grep -i "\/node"

That will return something like:

entity.node.canonical /node/{node} entity.node.delete_form /node/{node}/delete entity.node.edit_form /node/{node}/edit entity.node.preview /node/preview/{node_preview}/{view_mode_id} entity.node.revision /node/{node}/revisions/{node_revision}/view entity.node.version_history /node/{node}/revisions node.add /node/add/{node_type} node.add_page /node/add node.multiple_delete_confirm /admin/content/node/delete node.revision_delete_confirm /node/{node}/revisions/{node_revision}/delete node.revision_revert_confirm /node/{node}/revisions/{node_revision}/revert node.revision_revert_translation_confirm /node/{node}/revisions/{node_revision}/revert/{langcode} search.help_node_search /search/node/help search.view_node_search /search/node view.frontpage.page_1 /node

Listing all the possible routes with that word, we can choose one and do:

drupal router:debug entity.node.canonical

And that will display more information about a specific route:

Route entity.node.canonical Path /node/{node} Defaults _controller \Drupal\node\Controller\NodeViewController::view _title_callback \Drupal\node\Controller\NodeViewController::title Requirements node \d+ _entity_access node.view _method GET|POST Options compiler_class \Drupal\Core\Routing\RouteCompiler parameters node: type: 'entity:node' converter: paramconverter.entity _route_filters method_filter content_type_header_matcher _route_enhancers route_enhancer.param_conversion _access_checks access_check.entity

So in this way we can search the route without the needing to search in all the *.routing.yml files and in this example the route is entity.node.canonical and the param expected is node.

Print links directly within a twig template

It is also possible to print links directly on the twig template with the following syntax:

<a href="{{url('entity.node.canonical', {'node': node.id( ) }}"> {{ 'This is a link'|t }} </a>

Add links inside a t() method.

If you want to add a link inside the t() method you need to pass the link as a string, something like this:

use Drupal\Core\Link; $link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1])); $this->t('You can click this %link' ['%link' => $link->toString()]);
Categories: Blogs

Drupal core announcements: Drupal core security release window on Wednesday, April 19, 2017

April 14, 2017 - 12:29pm
Start:  2017-04-19 12:00 - 23:00 UTC Organizers:  xjm catch cilefen David_Rothstein stefan.r Event type:  Online meeting (eg. IRC meeting)

The monthly security release window for Drupal 8 and 7 core will take place on Wednesday, April 19.

This does not mean that a Drupal core security release will necessarily take place on that date for any of the Drupal 8 or 7 branches, only that you should watch for one (and be ready to update your Drupal sites in the event that the Drupal security team decides to make a release).

There will be no bug fix or stable feature release on this date. The next window for a Drupal core patch (bug fix) release for all branches is Wednesday, May 03. The next scheduled minor (feature) release for Drupal 8 will be on Wednesday, October 5.

For more information on Drupal core release windows, see the documentation on release timing and security releases, and the discussion that led to this policy being implemented.

Categories: Blogs

I Fix Drupal: Synchronising production Drupal database to a dev environment

April 14, 2017 - 11:13am
Drush has a great feature that allows you to limit the data that will be exported when you dump a database. Using this feature you can pull the schema for the entire database while specifying tables who's data you wish to ignore. This can substantially reduce the time it takes to complete an sync operation, especially the time spent importing the DB on the target. The key to this piece of magic lies inside drushrc.php, where you can predefine those lists of tables that do not require data to be dumped using this option. $options['structure-tables']['common'] = array('cache', 'cache_*', '...
Categories: Blogs

Dropsolid: Online payments in Drupal

April 14, 2017 - 4:36am
Online payments in Drupal Thierry Fri, 04/14/2017 - 09:36

In this day and age, it’s very hard to imagine a world without online payments. They permeate every possible sector and purpose, ranging from banking apps to online ticket ordering and charity donations.

Drupal has kept pace with this evolution and is offering enterprise-quality solutions to tackle most online payment needs, most notably Drupal Commerce with secure payment integrations. Drupal Commerce allows developers to implement different gateways to PayPal, Stripe, iDeal, Mollie and Ingenico (previously known as Ogone).

In this blog post, I will explain the possibilities of the Drupal Payment module and describe an example of how to apply it together with Mollie, a rising star in the realm of payment service providers.

 

Drupal Payment module

Are you looking to make people pay for their membership when they register for an account? Then you will have to integrate an easily manageable payment system into your application.

In situations like these and more, Drupal’s Payment module can act as a bridge to a secure payment integration. You can implement different payment gateways that communicate directly with the Payment module. This means that all incoming payments from various payment service providers are stored in a centralised location.

The Payment module integrates well with Drupal Commerce and Ubercart, but you can even integrate the module into any kind of entity with both the Payment form field and the Payment reference field.

Do you think this might suit your need as an out-of-the-box solution for a simple integration with Drupal Webforms or a basic donation form with Drupal Payment integration? They are available for download on drupal.org.
 

Payment Service Providers

If you would like to receive online payments through you website, you'll have to implement an actual payment service provider. The most commonly used payment providers in the Benelux are Ingenico, Paypal and Mollie.


Mollie

Mollie has become very popular very quickly, because it charges a transaction-based fee instead of a monthly subscription. This means that you will not be charged if there are no transactions, which is perfect for projects that do not (yet) generate a lot of transactions.

To allow for easy integration, Mollie provides developers with a very good API. Drupal (and other) developers can access the available RESTful service or a PHP API library, which makes it possible to implement logic - for example to refund a customer through the API.
If your Drupal project does not require automatic refunding of customers, you can use the mollie_payment module, which uses Mollie’s PHP API library.
 

Example: enabling a payment method

To enable payments with Mollie, you have to define a payment method using the so-called MolliePaymentMethodController. The controller is defined in the Mollie Payment module and uses Mollie's PHP API library to process the requests.

You can add the Payment method through the module install file:

/** * Add payment method (Mollie) */ function MYMODULE_update_7001(){ $mollie = new PaymentMethod(array( 'controller' => payment_method_controller_load('MolliePaymentMethodController'), 'controller_data' => array('mollie_id' => 'test_AA11bb22CC33dd44EE55ff66GG77hh'), 'name' => 'pay_with_mollie', 'title_generic' => 'Pay with Mollie', 'title_specific' => 'Pay with Mollie', )); entity_save('payment_method', $mollie); }

 

Forms embedding a payment form

Start by defining a simple form, extendable with multiple form elements available in Drupal’s Form API.

/** * Callback function to build a basic payment form. * * @param array $form * The form build array. * @param array $form_state * The form state information. */ function MYMODULE_form($form, $form_state) { $form = array(); // Add form actions. $form['actions'] = array( '#type' => 'actions', ); $form['actions']['save'] = array( '#type' => 'submit', '#value' => t('Pay with Mollie'), ); return $form; }

 

This form is then capable to embed a payment form, provided by the Payment module. In order to do this, you should first define a Payment object. This will provide all the payment methods that have to be integrated in the payment form. You can pass context and context data for reference and later use, the currency you are making a payment in and the callback that has to be executed after a payment has been done.

// Define a payment object. $payment = new Payment(); $payment->context = 'donation'; $payment->context_data = array( 'time' => time(), 'type' => 'donation', ); $payment->currency_code = 'EUR'; $payment->description = 'Basic payment form'; $payment->finish_callback = 'MYMODULE_finish_callback';

 

A single payment object can contain multiple items. Useful if you would like to implement this in a commerce environment. In this example, a single line item will define the total amount that has to be paid. Don't forget to define the price without taxes, because the Payment module will handle all tax calculations.

// Define a payment line item. $line_item = new PaymentLineItem(); $line_item->amount = 100.00 / 1.21; $line_item->name = t('EUR 100'); $line_item->tax_rate = 0.21; $line_item->quantity = 1; // Add the payment line item to the payment object. $payment->setLineItem($line_item);

 

By assigning the payment object to the form, you can use the transferred information in a later stage - for instance during validation.
 

// Add the payment object to the form. $form_state['payment'] = $payment;

You can use multiple payment methods with the payment module. In this example, Mollie is forced as the only payment option available. It is of course also possible to add multiple methods in the payment options and to allow people to pick their payment method of choice.

 

// Get available payment methods and limit this form to Mollie payment. $payment_methods = $payment->availablePaymentMethods(); $payment_options = array(); foreach ($payment_methods as $payment_method) { if ($payment_method->enabled && $payment_method->name == 'pay_with_mollie') { $payment_options[] = $payment_method->pmid; } }

To include the payment form into your custom form, you have to call the payment_form_embedded function. The function will use the payment object and the available payment options to build the required form elements and form actions. Then assign the payment elements and submit action to your custom form in order to enable the payment.

// Get the payment embed elements. $payment_embed_form = payment_form_embedded($form_state, $payment, $payment_options); // Add the embedded payment form element. $form['payment'] = $payment_embed_form['elements']; // Define the form submit callback. $form['#submit'] = $payment_embed_form['submit'];

When defining the payment object, you actually define a finished callback. This callback will be triggered after a successful payment from the Mollie payment service provider. To be certain, you could check if there is a payment success status within the payment object and run any additional callbacks if needed.

/** * Handle successful payment from Mollie. * * @param \Payment $payment * The returned payment object containing all relevant information. */ function MYMODULE_finish_callback(Payment $payment) { $payment_complete = FALSE; // Check if the payment status contains a successful state. foreach ($payment->statuses as $status) { if ($status->status == 'payment_status_success') { $payment_complete = FALSE; break; } } if ($payment_complete) { drupal_set_message('Your payment has been received.', 'success'); // @TODO: Implement custom callbacks. } }

 

Conclusion

As you noticed, it's not that hard to implement a payment workflow in your own form! 

One final tip: use form validation to check if all requirements are met before people are redirected to the payment service provider.

I hope this blog post has helped you to make payments in Drupal easier. Feel free to leave a comment below if you have any questions or if you would like to share some thoughts on different possible approaches.

Add new comment Header image Tags Drupal 8 Tech Teaser image Publish to Drupal planet On
Categories: Blogs

Aten Design Group: See you at DrupalCon Baltimore, hon!

April 13, 2017 - 2:56pm

It’s that time of year again when the Drupal community of developers, designers, strategists, project managers and more come together for the biggest Drupal event in the world: DrupalCon North America. This year, from April 24-28, we'll be in Baltimore and here’s where you can find us:

The Aten Booth

Be sure to stop by booth 216 in the exhibit hall, we’d love to chat about the successes and challenges you face in your web projects. We’ll also have our sought-after sketchbooks to add to your collection.

Monday, April 24 Nonprofit Summit

We are thrilled to support the newly added Nonprofit Summit at DrupalCon this year. Chris, Aten’s Director of Digital Strategy, and Joel, Aten’s Director of Engineering, work closely together and are sharing tips to create intuitive and compelling experiences for organizations to successfully connect with their users.

Tuesday, April 25

Mastering Drupal 8’s Libraries API
Matt Jager
2:45 p.m. - 3:15 p.m.
Room: 307 - Acquia

Wednesday, April 26

Powering an Interactive SVG and JavaScript Game Engine with Drupal
Peter Weber
2:45 p.m. - 3:15 p.m.
Room: 307 - Acquia

A Type System for Tomorrow
Gabe Sullice
3:45 p.m. - 4:45 p.m.
Room: 318 - New Target

Thursday, April 27

Testing for the Brave and True
Gabe Sullice
10:45 a.m. - 11:45 a.m. Room: 315 - Symfony

Categories: Blogs

Mediacurrent: Inclusive Development: Using Style Guides to Improve Website Accessibility

April 13, 2017 - 12:58pm
What exactly is the role of a Front-end developer?

What exactly does it mean to be a 'front-end developer'? From company to company? From website to website? Really, from day to day? Does your colleague actually do the same job as you? For example, some days I’m working in InDesign or Photoshop all day, the next I’m writing jQuery or building theme components. The very next day I am writing a blog post, prepping for a presentation, or doing research on the latest trends.

Categories: Blogs

Mediacurrent: Inclusive Development: Using Style Guides to Improve Website Accessiblity

April 13, 2017 - 12:58pm
What exactly is the role of a Front-end developer?

What exactly does it mean to be a 'front-end developer'? From company to company? From website to website? Really, from day to day? Does your colleague actually do the same job as you? For example, some days I’m working in InDesign or Photoshop all day, the next I’m writing jQuery or building theme components. The very next day I am writing a blog post, prepping for a presentation, or doing research on the latest trends.

Categories: Blogs

Pages