Newsfeeds

Commerce Coupon Bulk Import

New Drupal Modules - 28 November 2017 - 4:13pm

Import coupons from a CSV file into a selected promotion on Drupal Commerce. For promotions such as Groupon.

Categories: Drupal

PreviousNext: Workflows: A new tool in the toolbox

Planet Drupal - 28 November 2017 - 3:26pm
Share:

At DrupalSouth 2017, I presented a session on the new Workflows module, which just went stable in Drupal 8.4.0. Workflows was split out from content moderation as a separate module, and can be used independently to create custom workflows. In this presentation, I gave a demonstration of how to create a basic workflow for an issue tracker.

by Kim Pepper / 29 November 2017

Since 2011 we have had access to a content moderation tool in Drupal 7 in the form of Workbench Moderation. This module introduced the concept of Draft ➡ Review ➡ Published workflows, with different user roles having specific permissions to move from one state to the next.

Unfortunately, the underlying Drupal core revision API was not designed to deal with this, and there were some pretty crazy workarounds.

Content moderation has long been a key feature request for Drupal, and so effort was made to port Workbench Moderation across to Drupal 8. 

Content Moderation drove a lot of cleanup in Drupal core APIs, including proper support for forward revisions, and adding revision support to other content entities besides Content Types, such as Custom Blocks. More are on the way.

In Drupal 8.3, the Workflows module was split out of Content Moderation. Why you may ask? Well, because the Workflows module provides the state machine engine that Content Moderation relies on.

What is a State Machine?

A state machine defines a set of states and rules on how you can transition between those states.

A door state machine

In our simple example of a door, it can only be opened, closed or locked. However, you can't go directly from locked to open, you need to unlock it first.

Content Moderation Workflow Configuration

Content Moderation provides a set of Workflow states and transitions by default.

Content Moderation StatesContent Moderation Transitions

If we were to put this together in a state machine diagram, it would look like the following:

Content Moderation State Machine

From the above diagram, it becomes clear what the allowed transitions are between states.

So now Workflows has been configured with our Content Moderation states and transitions, what is left for Content Moderation to do?

What Does Content Moderation Do?

It turns out quite a lot. Remember, that Workflows only provides the state machine. It in no way prescribes how you should manage the current state of a particular entity.

Content Moderation provides:

  • Default Workflows configuration
  • A fairly complex WorkflowType plugin which works with the Revision API.
  • Storage for individual states on content entities
  • Configuration of which entity bundles (Content types, etc.) should have Content Moderation
  • A number of admin forms for configuring the workflows and how they apply
  • Permissions
Building an Issue Tracker

We want to build a very simple issue tracker for our example. The state machine diagram is the following:

Issue Tracker State Machine

That's the simple bits out of the way. Now, in order to build an issue tracker, we will need to replicate the rest what Content Moderation does!

Fortunately there is a module that can do most of the heavy lifting for us.

Workflows Field

“This module provides a field which allows you to store states on any content entity and ensure the states change according to transitions defined by the core workflows module.” 

Perfect! Let's download and install it.

Next we want to add a new Workflow. We can assign it a label of Issue Status and you'll see that we have a new Workflows Field option in the Workflow Type dropdown.

Add new workflow

We can then configure the desire Workflows states and transitions.

Issue StatesIssue Transitions

Thats the our Workflows configured. Now we need to create a new Issue content type to attach our workflow to. It's assumed you know how to create a content type already. If not, check out the User Guide.

Next, we need to add our Workflows Field to our Issue content type. Follow the usual steps to add a field, and in the drop down choose Workflows as the field type, and our previously created Issue Status workflow.

Add workflows fieldTest it out!

Now we can test our our workflow by creating a new Issue from the Content page. If everything was configured correctly, we should see a new field on the edit form for Status.

Issue status form

Given the transitions we defined in our workflow, we should only be allowed to see certain values in the drop-down, depending on the current state.

Testing workflow constraintsWhat next?

That's it for setting up and configuring a custom workflow using Workflows Field. Some next steps would be:

  • Add permissions for certain users (there's an issue for that #2904573 )
  • Add email notifications
How would you use the new Workflows API?

Let me know in the comments!

Tagged Workflows, Content Moderation

Posted by Kim Pepper
Technical Director

Dated 29 November 2017

Add new comment
Categories: Drupal

NuÆther RPG Up On Kickstarter

Tabletop Gaming News - 28 November 2017 - 3:00pm
Sure, many of us play video games. But how many of us actually get to play inside video games? That’s where NuÆther comes in. It’s a new RPG that puts you in the world of video games. And not just a fantasy setting like you’d find in an RPG, but a video game RPG, itself. […]
Categories: Game Theory & Design

Andoria Battlefields Card Game Up On Kickstarter

Tabletop Gaming News - 28 November 2017 - 2:00pm
Not every Kickstarter makes it the first time around. But with some retooling, reconfiguring, and a good relaunch, they can make it further than ever. Well, Andoria Battlefields is back up on Kickstarter and they’re doing quite well. If you’re looking for a drafting, area control, battle card game, you’ll want to check it out. […]
Categories: Game Theory & Design

Z-Man Games Previews Factions from Gaia Project

Tabletop Gaming News - 28 November 2017 - 1:00pm
The galaxy is a large place. But when there’s 14 different races looking to colonize it, it can seem really small really quickly. Each faction has things it specializes in and ways to play. So, when sitting down for a game of Gaia Project, how do you choose which one you want to play? Well, […]
Categories: Game Theory & Design

DrupalCon News: Calling all Drupalers!

Planet Drupal - 28 November 2017 - 12:36pm

We want to hear your voice at DrupalCon. 

Categories: Drupal

Ares Games Launches Tripods & Triplanes Kickstarter

Tabletop Gaming News - 28 November 2017 - 12:00pm
During the midst of the Great War, the skies opened up and the heavens rained down. But this wasn’t the enemy’s shells. This was vehicles from another planet. The Martians are invading and both sides are finding that there’s a new force to deal with. That’s the story behind Tripods and Triplanes, a new standalone […]
Categories: Game Theory & Design

Acro Media: Video: Recurring Billing, Now Baked Right In to Drupal Commerce 2

Planet Drupal - 28 November 2017 - 11:06am

If you ever have need of timed or delayed payments, we have some good news: recurring billing (also known as subscriptions) is new and improved in Commerce 2. Check out this week's High5 episode and learn more!

What is recurring billing?

It's anything where we want to have a transaction happen after the initial time when a customer is on our site. That might be monthly or yearly, or it might be when you want the last half of the payment to go through in a couple days or a week.

How does it work?

It's not like we store pictures of everyone's credit cards and just keep applying charges to them. Instead, we store tokens, or references to the credit cards. This is much safer because it means that even if the site got hacked, no one would have access to your actual banking information. At no point does Commerce ever store your actual credit card.

If you're interested in reading more about tokenization, Wikipedia has a lot of good information on the subject. 

How is this different from Commerce 1?

We sort of had tokenization (a.k.a card on file) in Commerce 1. It was a contrib module and wasn't actually part of Commerce itself. Some payment gateways supported it, some didn't, some did but only partially… it was much more of an ad hoc thing.

Now, tokenization is built into Commerce, so any major payment gateway that gets set up and has the capacity to store tokens (which is most of them), will do so. You don't need to do anything special for your payment gateway to handle recurring billings. As long as we have that token, we can keep making charges to it until that token becomes invalid (i.e. the card gets cancelled).

It was actually a credit to Commerce 1 that it had tokenization at all. It's a complex thing. For instance, if a payment doesn't go through, do we have to cancel the subscription? Do we have to get the product back? Do we do that immediately, or give them a window of time to put in the new card? A lot of ecommerce setups just avoided that entirely, so it was definitely a strength of Commerce 1, and now it's really a strength of Commerce 2.

The bottom line

Recurring billing rocks, and is now built right into Commerce 2. 

Categories: Drupal

Podcast Roundup

Tabletop Gaming News - 28 November 2017 - 11:00am
It’s the Tuesday after a very long weekend. I think it’s the day that actually feels like Monday. The actual Monday was some crazy thing that threw us from our homes back into the working world. I know I had a ton of stuff to catch up on yesterday. Some of it’s spilling over today. […]
Categories: Game Theory & Design

Advanced Access

New Drupal Modules - 28 November 2017 - 10:41am

Advanced Access is an access control suite designed to provide an extensible access control system that leverages plugins to determine access pathways. The module extends the concepts of the node_access implementation in code to support additional entity types and to make the interface between access modules simple.

Categories: Drupal

Wyrd’s Winter Wonderland Issue Is Your Gain

Tabletop Gaming News - 28 November 2017 - 10:00am
Working in the gaming industry, there’s a lot of going ahead with plans as set on your timetables and hoping that everything should work out right. Occasionally, they don’t. Something comes back from the printer’s that’s messed up. A sculptor’s work gets destroyed in a freak accident. Or you end up with a box of […]
Categories: Game Theory & Design

Dual virtual reality/treadmill exercises promote brain plasticity in Parkinson's patients

Virtual Reality - Science Daily - 28 November 2017 - 9:01am
A new study suggests that a therapy that combines virtual reality and treadmill exercise dramatically lowers the incidence of falling among Parkinson's patients by changing the brain's behavior and promoting beneficial brain plasticity, even in patients with neurodegenerative disease.
Categories: Virtual Reality

Through the Desert Now Available From Z-Man Games

Tabletop Gaming News - 28 November 2017 - 9:00am
Occasionally, older games need a bit of a revamp. There’s nothing wrong with that. Boards and other game pieces get a touch-up in quality. Rules get tightened and streamlined. Overall, you get a better gaming experience from an already-great game. Such is the case with Through the Desert, of which a new edition is now […]
Categories: Game Theory & Design

Jacob Rockowitz: Removing paid promotions from the Webform module and not asking for forgiveness

Planet Drupal - 28 November 2017 - 9:00am

I have decided to remove paid promotions from the Webform module to focus on promoting the Drupal Community as a whole, the Drupal Association, and Webform module, I am also comfortable stating that I am not asking for forgiveness for my decision.

It is important that the Drupal community understand that I reached out to Lingotek and chose to promote their services within the Webform module's UX. Lingotek has made and continues to make amazing contributions to Drupal and the community. I want to thank them for allowing me to promote their services in such an experimental way.

Removing the paid promotion

I documented my original intentions in a blog post about promoting paid services within the Drupal community. I have come to fully agree with lslinnet's comment...

The Drupal community needs to explore ways to help support and fund core contributors and project maintainers. The goal of the paid promotion experiment was to see how everyone, including myself, felt about this concept.

The Discussion

MortenDK's (mortendk) very upset and direct tweet triggered the largest debate...

A few responses resonated with me, including one by kevinquillen and this one by tedbow:

Yes, the promotions of third-party services within a module's UX could open some floodgates that could create a horrendous user experience and first impression of Drupal. First impressions are very...Read More

Categories: Drupal

Acquia Developer Center Blog: Creating a Decoupled Drupal Application in 30 Minutes with Lightning, BLT, and DrupalVM

Planet Drupal - 28 November 2017 - 8:43am

Acquia’s Professional Services team recently released an open-source application that demonstrates how Drupal and Node.js can easily be paired to create beautiful and functional decoupled applications. See how easy it was to create the Drupal backend using a combination of Acquia and Drupal community projects such as Lightning, BLT, and DrupalVM. This will allow you to follow the same process to rapidly create your own custom decoupled applications.

Tags: acquia drupal planet
Categories: Drupal

How social media can help people lose weight

Virtual Reality - Science Daily - 28 November 2017 - 8:35am
Sharing the triumphs and tribulations of your weight loss journey with other members of an online virtual support community plays an important role in achieving success, according to a new study. The study examines the role of virtual communities and public commitment in setting and reaching weight loss goals.
Categories: Virtual Reality

Promet Source: Drupal Commerce: Powering ALA.org on Giving Tuesday

Planet Drupal - 28 November 2017 - 8:34am
Promet Source is proud to partner with the American Library Association (ALA) to deliver a flawless user experience with Drupal Commerce on Giving Tuesday, and every day of the year. Related: ALA | Empowering Association Fundraising with Drupal Commerce
Categories: Drupal

Privateer Press Posts New Warmachine/Hordes Previews

Tabletop Gaming News - 28 November 2017 - 8:00am
Privateer Press has updated their homepage with quite an assortment of new previews. There’s some Retribution, there’s some Trollbloods, there’s some Cygnar, there’s some Circle… like I said, it’s a bit of everything. If you want to know what’ll be coming out soon, there’s apparently a lot, and chances are good your faction will be […]
Categories: Game Theory & Design

Racing Level design : The rally case - by Benoit GOMES

Gamasutra.com Blogs - 28 November 2017 - 7:02am
How to create an unperfect road network to create the perfect rally environnment? Rally is aiming for an intense driving experience with a four wheel drive monster on the most oppressing roads. This is how we created an acclaimed driving hell in WRC7
Categories: Game Theory & Design

Video: Open World Coop Level Design Direction. - by Ben Bauer

Gamasutra.com Blogs - 28 November 2017 - 7:01am
This animated video is an in-depth look at what it takes to create open world levels with a unique focus on coop.
Categories: Game Theory & Design

Pages

Subscribe to As If Productions aggregator