Planet Drupal

Subscribe to flux Planet Drupal
Drupal.org - aggregated feeds in category Planet Drupal
Mis à jour : il y a 9 min 30 sec

Amazee Labs: First Day of DrupalCon Latin America

mer, 11/02/2015 - 13:43
First Day of DrupalCon Latin America

It is awesome to be here! Everything was well prepared and we were very warmly welcomed.

The 200-300 attendees come from everywhere - there is a good portion of people from the US, from Europe and of course many Latin Americans from all over the continent. It’s a unique and really fascinating mix of Drupalistas.

It started off with the introduction by Holly. Multilinguality is not only in core of D8 but also in core of the Drupal Association: Holly kick-off in fabulous spanish! 

More multilingual features of the Con are the real-time translations of talks in Portuguese and Spanish. And of course the entire organization team bridges the gap between the Latinos and the rest of the world.

A highlight of the day was the keynote of Dries. User experience will always win is his credo. Dries predicted for the next 10 to 20 years that the user experience will change from pull to push. Personal, aggregated and situation-based services such as Google Now will be predominant and push useful information to us. 

I personally like the talks of Larry Garfield about Design Systems a lot and also Andy Kucharski's talk about measuring support and client relationships.

Both talks are already online and fotos can be found on our flickr page

We are excited for day 2! Hasta Luego

Catégories: Elsewhere

InternetDevels: Drupal module providing custom rules actions for node.js

mer, 11/02/2015 - 11:38

And yet another module aiming to make your life easier. Let’s say, you have a social network website developed on Drupal, or any other website, requiring communication between users. Naturally, you’d want to implement notifications service in addition to private messages feature. Would be cool, if users would be notified, who appeared online, who wrote the comment or message to them, right?

Read more
Catégories: Elsewhere

Lullabot: Bill Haenel: Free Software in Public Media

mer, 11/02/2015 - 07:13

In this second episode of Hacking Culture, Matthew Tift talks with Bill Haenel from North Country Public Radio about free software in public media.

All music used in this episode comes from the Open Goldberg Variations, performed by Kimiko Ishizaka.

This episode is released under the Creative Commons attribution share alike 3.0 United States license.

Catégories: Elsewhere

Modules Unraveled: 130 Building Sites with Drush Recipes and Profile Builder with Bryan Ollendyke - Modules Unraveled Podcast

mer, 11/02/2015 - 05:46
Published: Tue, 02/10/15Download this episodeProfiler Builder
  • What is Profiler Builder?
    • Profiler Builder was created cause I’m lazy and wanted to just build a site, then figure out the profile, not build both at the same time. My work on profiler builder started to lead me toward the notion that install profiles and distributions can be more of a pain then they are worth, hence recipes.
  • Is there anything that Profiler Builder doesn’t catch?
  • How are you using Profiler Builder?
Drush Recipes
  • What is the Drush Recipes plugin
    • Drush Recipes is a series of drush calls chained together in a lightweight command-file, similar to chef and it’s recipes / roles structure.
  • Why do this instead of just using standard drush calls?
    • You might need to mess around w/ it to get a sense of some of the things you can do with it since it’s a lot more then just chain automation as it supports branching path logic, automatic recipe authoring, drush commandline recording to author recipes, the ability to take two sites and engineer the difference between them (as drush calls), remote loading of recipes, etc.
  • I use TextExpander to do this, so I just type a shortcut, and my commands are filled in. How is using Drush Recipes different?
  • Use cases for this?
    • First-time site builds
    • Development/Testing
    • drush ddt
    • drup
    • dvr
    • Chain them together (reference)
    • dwr - Interactive (What theme do you want to install?)
    • Madlib (Tokenize Drush commands)
    • Reference Make files
  • Where can we see your recipes and contribute our own?
Episode Links: Bryan on drupal.orgBryan on TwitterDrush RecipesProfile BuilderTags: planet-drupal
Catégories: Elsewhere

Mediacurrent: Contrib Committee Progress Report for January 2015

mar, 10/02/2015 - 22:40

When we started on our plan to organize Mediacurrent's contributions at the start of the month we had certain goals in mind. The first was to improve collaboration amongst our staff, to help and learn from each other, and a secondary goal was to get some module releases out the door. How did we do?

Catégories: Elsewhere

Web Wash: Control Breadcrumbs using Path Breadcrumbs in Drupal 7

mar, 10/02/2015 - 22:34

Implementing breadcrumbs in Drupal can be difficult depending on your requirements. Drupal out of the box will generate a breadcrumb based off the menu structure, however, things start to get a little tricky when you want to modify breadcrumbs.

There are a lot of modules that allow you to control breadcrumbs in their own unique way. To name a few you have Crumbs, Custom Breadcrumbs and more.

The module that I've had the most success with is the Path Breadcrumbs. This module offers great flexibility with an easy to use interface. Path Breadcrumbs' configuration can also be exported using Features which is another huge win.

Catégories: Elsewhere

Drupal core announcements: Drupal8 classy themes template file organization

mar, 10/02/2015 - 22:13

Just a heads up We are now talking about how to organize the templates inside of classy, we need input https://www.drupal.org/node/2349559 - yes the banana is moving forward :)

/mortendk

Catégories: Elsewhere

Drupal core announcements: All the sprints at and around DrupalCon Barcelona

mar, 10/02/2015 - 20:11
Start:  2015-09-19 (All day) - 2015-09-27 (All day) Europe/Madrid Sprint

https://barcelona2015.drupal.org/

We have a great tradition of extended sprints around big Drupal events including DrupalCons and Drupal Dev Days. While there is a sprint day included in DrupalCons (usually) on Friday, given that a lot of the Drupal core and contrib developers fly in for these events, it makes a lot of sense to use this opportunity to start sooner and/or extend our stay and work together in one space on the harder problems.

DrupalCon Barcelona is coming up! DrupalCon and the Drupal Association continue to recognize the need for extended sprints as part of the schedule and are providing space on Monday, and helping organize space for the weekends before and after also! The host event is looking for sponsors to help make the sprints happen, so you have a comfortable environment with internet, coffee, tea and maybe food. There are already various sprints signed up including Multilingual, Drupal.org, Rules, Media, Content staging, Migration and Frontend. We are really friendly and need all kinds of expertise!

Now is the time to consider if you can be available and book your travel and hotel accordingly!

There is even a possible stop over sprint in Montréal September 11 -18, for those coming from North America west coast or New England.

Join the sprinters -- sign up now! Practical details
Dates
September 19 to 27
Times and locations
Day/Time Location Event Saturday September 19, 09:00 to 24:00. TBA, TBA Extended sprint. Sunday September 20, 09:00 to 24:00. TBA, TBA. Extended sprint. Monday September 21, 09:00 to 18:00. TBA, Room TBA, Convention Center.. Sprints at the Convention Center. Concurrent with community summit. Capacity 120+. Tuesday September 22-Thursday September 24, 09:00 to 18:00. Room TBA, Convention Center. TBA. Sprints at the Convention Center. Friday September 25, 09:00 to 18:00. Room TBA, Convention Center, TBA. The DrupalCon Sprint, Mentored Core Sprint, and First-Time Sprinter Workshop at the Convention Center. Capacity 300+. Saturday September 26, 09:00 to 24:00. TBA, TBA Extended sprint. Sunday September 27, 09:00 to 24:00. TBA, TBA. Extended sprint.
Sponsors

The Drupal Association (@DrupalAssoc), and ??.

Looking for sponsors

We are looking for more sponsors to be able to pay for extra expenses for the sprint too. If you are interested sponsoring or if you need sponsors to cover expenses, please contact me at https://drupal.org/user/258568/contact

Frequently asked questions What is a sprint?

Drupal sprints are opportunities to join existing teams and further Drupal the software, our processes, drupal.org and so on.

Do I need to be a pro developer?

No, not at all. First of all sprints include groups working on user experience, designs, frontend guidelines, drupal.org software setup, testing improvements, figuring out policies, etc. However you can be more productive at most sprints if you have a laptop.

How come there are 9 consecutive days of sprints?

DrupalCon is the time when most people in the Drupal community get together. We try to use this time to share our knowledge as well as further the platform in all possible ways. Therefore there is almost always an opportunity and a place to participate in moving Drupal forward.

What if I'm new to Drupal and/or sprinting, how can I join?

If you feel new and would love helping hands, the best day to start is the Friday sprint day. This is the biggest sprint day with hundreds of people sprinting and different opportunities based on experience level. For a guided introduction to the tools and processes we use to collaborate, go to the First Time Sprinter workshop in the morning. If you know the tools but still could use help picking issues and going through the process, the Mentored Core Sprint is for you.

I worked on Drupal before, which sprints are for me?

If you have experience with Drupal issues and maybe already know a team/topic, any days of a DrupalCon may be your sprint days, and even both weekends before and after. These sprints do not have formal mentoring available, but of course if you have questions, there are always plenty of friendly people to help you. The community organizes off-site sprint opportunities for the weekends before/after DrupalCon and the event itself provides sprint locations from Monday morning to Friday night throughout the week both in the event venue and in the official event hotel. These sprints are broken down to teams working on different topics.

Why do I have to sign up?

Topics (including a general, I will work on anything) are listed in the google doc. It is very important that you sign up for them, so we know what capacity to plan with, so we have enough space (and maybe food/coffee).

Further questions?

Ask me (YesCT), I am happy to answer.

#node-427578 .picture, #node-427578 h3 { display: none; } #node-427578 .field-type-datestamp { margin: 0 0 2em 0; } #node-427578 dl { margin-bottom: 1em; } #node-427578 dd { margin-top: 0.5em; } #node-427578 h3.content { display: block; }
Catégories: Elsewhere

Drupal core announcements: All the sprints at and around DrupalCon Los Angeles

mar, 10/02/2015 - 19:49
Start:  2015-05-09 (All day) - 2015-05-17 (All day) America/Los_Angeles Sprint

https://events.drupal.org/losangeles2015

We have a great tradition of extended sprints around big Drupal events including DrupalCons and Drupal Dev Days. While there is a sprint day included in DrupalCons (usually) on Friday, given that a lot of the Drupal core and contrib developers fly in for these events, it makes a lot of sense to use this opportunity to start sooner and/or extend our stay and work together in one space on the harder problems.

DrupalCon Los Angeles is next up! DrupalCon and the Drupal Association continue to recognize the need for extended sprints as part of the schedule and are providing space on Monday, and helping organize space for the weekends before and after also! The host event is looking for sponsors to help make the sprints happen, so you have a comfortable environment with internet, coffee, tea and maybe food. There are already various sprints signed up including Multilingual, Drupal.org, Rules, Media, Content staging, Migration and Frontend. We are really friendly and need all kinds of expertise!

Now is the time to consider if you can be available and book your travel and hotel accordingly!

Join the sprinters -- sign up now! Practical details
Dates
May 9 to May 17
Times and locations
Day/Time Location Event Saturday May 9, 09:00 to 24:00. TBA, TBA Extended sprint. Capacity 71. Sunday May 10, 09:00 to 24:00. TBA, TBA. Extended sprint. Capacity 71. Sunday May 10, 14:00 to 24:00. TBA, TBA. Extended sprint overflow. Capacity 30. Monday May 11, 09:00 to 18:00. TBA, Room TBA, Los Angeles Convention Center.. Sprints at the Los Angeles Convention Center. Concurrent with community summit. Capacity 100+. Tuesday May 12-Thursday May 14, 09:00 to 18:00. Room TBA, Los Angeles Convention Center. TBA. Sprints at the Los Angeles Convention Center. Capacity 100+. Tuesday May 12-Thursday May 14, hours ??. Westin Bonaventure Hotel, TBA. Coder Lounge. Friday May 15, 09:00 to 18:00. Room TBA, Los Angeles Convention Center, TBA. The DrupalCon Sprint, Mentored Core Sprint, and First-Time Sprinter Workshop at the Los Angeles Convention Center. Capacity 100+. Saturday May 16, 09:00 to 24:00. TBA, TBA Extended sprint. Capacity 71. Sunday May 17, 09:00 to 24:00. TBA, TBA. Extended sprint. Capacity 71.
Sponsors

The Drupal Association (@DrupalAssoc), and ??.

Looking for sponsors

We are looking for more sponsors to be able to pay for extra expenses on the sprint too. If you are interested sponsoring or if you need sponsors to cover expenses, please contact me at https://drupal.org/user/258568/contact

Frequently asked questions What is a sprint?

Drupal sprints are opportunities to join existing teams and further Drupal the software, our processes, drupal.org and so on.

Do I need to be a pro developer?

No, not at all. First of all sprints include groups working on user experience, designs, frontend guidelines, drupal.org software setup, testing improvements, figuring out policies, etc. However you can be more productive at most sprints if you have a laptop.

How come there are 9 consecutive days of sprints?

DrupalCon is the time when most people in the Drupal community get together. We try to use this time to share our knowledge as well as further the platform in all possible ways. Therefore there is almost always an opportunity and a place to participate in moving Drupal forward.

What if I'm new to Drupal and/or sprinting, how can I join?

If you feel new and would love helping hands, the best day to start is the Friday sprint day. This is the biggest sprint day with hundreds of people sprinting and different opportunities based on experience level. For a guided introduction to the tools and processes we use to collaborate, go to the First Time Sprinter workshop in the morning. If you know the tools but still could use help picking issues and going through the process, the Mentored Core Sprint is for you.

I worked on Drupal before, which sprints are for me?

If you have experience with Drupal issues and maybe already know a team/topic, any days of a DrupalCon may be your sprint days, and even both weekends before and after. These sprints do not have formal mentoring available, but of course if you have questions, there are always plenty of friendly people to help you. The community organizes off-site sprint opportunities for the weekends before/after DrupalCon and the event itself provides sprint locations from Monday morning to Friday night throughout the week both in the event venue and in the official event hotel. These sprints are broken down to teams working on different topics.

Why do I have to sign up?

Topics (including a general, I will work on anything) are listed in the google doc. It is very important that you sign up for them, so we know what capacity to plan with, so we have enough space (and maybe food/coffee).

Further questions?

Ask me (YesCT), I am happy to answer.

#node-427578 .picture, #node-427578 h3 { display: none; } #node-427578 .field-type-datestamp { margin: 0 0 2em 0; } #node-427578 dl { margin-bottom: 1em; } #node-427578 dd { margin-top: 0.5em; } #node-427578 h3.content { display: block; }
Catégories: Elsewhere

Appnovation Technologies: Another 5 Cool Drupal Websites

mar, 10/02/2015 - 19:06

In the past few years Drupal open source has been more widely used in building CMS websites for private enterprises, governments and non-profit organizations as its backend technology and capability have become more and more powerful and compatib

var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Catégories: Elsewhere

Drupal Watchdog: 30 Minutes and It's Free

mar, 10/02/2015 - 18:58
Article

Over the years, I've taught more than a handful of public workshops. Often, I'm teaching beginner sessions, and the learners are using laptops provided by work. The usual setup is a Windows environment locked down tighter than an airport security screening process. Fortunately, there is a public web site which allows anyone to evaluate Drupal projects online – free.

Simplytest.me is a web site created and maintained by Patrick Drotleff. The site allows individuals to create a sandbox with a Drupal installation which lasts 30 minutes (a counter appears in the bottom corner of the window for your convenience). As part of the installation process you may choose a specific version of Drupal, additional modules, and even specific patches to apply to your temporary Drupal installation.

The process is incredibly simple.

Step 1. Navigate to http://simplytest.me/

Step 2. In the text field, enter the name of the project you wish to test. Assuming you want to test Drupal core, you would simply type “Drupal”. A list of projects will appear: select “Drupal core”.

Step 3. Select the version of Drupal you would like to test. Most versions of Drupal 7 and Drupal 8 are available for testing.

Step 4. You may, optionally, specify additional modules, themes, or patches that you would like to test.

Step 5. Once you've selected the projects and patches you'd like to install, proceed with the installation by clicking “Launch sandbox”.

The relevant projects will be downloaded and your environment will be initialized.

Catégories: Elsewhere

Drupalize.Me: Panels, Blocks, Layouts and Drupal 8

mar, 10/02/2015 - 15:01

Over the years of Drupal 8 development we've heard a lot of talk about "Panels in core" or "Blocks everywhere" or "Layout all the things!" and even SCOTCH(?). What does it all mean? Is Panels actually in core? Well, no, but there are some cool improvements in Drupal 8. I decided to follow the breadcrumb trail to figure out what this initiative was really about and how it ended up, now that Drupal 8 is in beta. Join me for a little bit of a trip back through the life of the Blocks and Layouts Everywhere (SCOTCH) Initiative.

Catégories: Elsewhere

KatteKrab: DrupalEight @ DrupalSouth

mar, 10/02/2015 - 12:52
Tuesday, February 10, 2015 - 22:52

The number of critical issues holding up the release of Drupal 8 is now in the 50s. When will it be released? When it's ready. In the meantime there are some great opportunities around to start to get up to speed on what Drupal 8 is all about. Not least of which are 7 sessions at DrupalSouth in Melbourne next month.

Check them out:

First up, our keynote by Angela "webchick" Byron: Drupal 8: What you need to know

Since March 2011, the community has been hard at work on Drupal 8, which is currently undergoing active development. This revolutionary new release sports tons of improvements, and Angela Byron, Drupal core committer and long-time core developer, will lead you through the most important ones and how they'll impact your future site building endeavors.   Get answers to your frequently asked questions, learn about the changes coming down the pipe for clients, site builders, designers, and developers. You'll also find out more about the core development process, some tips and tricks on how the community works and how to contribute. Best of all, you'll take away some action steps on how you too can help make Drupal 8 the most awesome release of Drupal yet!    

Lee "larowlan" Rowlands: Contributing to Core without losing your mind

Contributing to Drupal core can be satisfying, educational, overwhelming, frustrating and many more emotions, all in the one issue.   In this session I'll share some things I've learned from contributing to Drupal 7 and Drupal 8 core.   Topics covered
  • Negotiating issue queues
  • Finding your niche
  • Git and patch workflows
  • Dealing with politics and personalities
  • Not sweating details
  • Development approaches
  • Learning through reviews
  • Building networks and friendships
  • Automating your processes with phing
  • Automated tests

 

Justin "beejeebus" Randell: Best practices for configuration management in Drupal 8

Drupal 8 ships with a new Configuration Management System (CMI) that vastly improves on Drupal 7. A Drupal site's configuration can be expressed as a set of yaml files, and stored and managed just like source code.   In this talk I'll explore the powerful new CMI features, and present best practice workflows for managing configuration across Drupal 8 projects.   Trying to figure out how Drupal 8's new CMI features will work with your development team? Come to this presentation and we'll try to work it out.    

Vladimir R and Josh Martin: Services in Drupal 8: using Drupal as data storage for mobile apps, web apps and websites

Web services is one of the official Drupal 8 incentives. Known as "headless Drupal", web services allow us to use Drupal as a data storage for applications and websites using various frameworks and technologies.    In this presentation we will cover
  1. Introduction to web services. We will cover origins and types of web services, crucial componets and basics to get us going. We will look into the difference between Drupal 7 and Drupal 8 service setup and why it was crucial to get services into the core. 
  2. Examples of use. Modern web applications, mobile application and a lot of web sites are using web services for reusing exisitng application components or connecting existing applications together. For this presentation we've built mobile application, simple website and booking web app using Drupal 8 as well as various other libraries to demonstrate the practical use of web services.
  3. Drupal 8 services configuration. In this section we will cover how to get your hands dirty "under the hood" by configuring Drupal to work in examples from the previous section.

 

David Peterson: How Everything is Connected - Drupal 8 and Schema.org

The world is complex and is full of connections and relationships amongst "real things". The web is complex and full of links between text, video and images.   How do we bridge this divide between the real world and the online web? The Graph. The knowledge graph defines what is important to us and how it relates to the things we care about.   When you publish a Drupal site is built with rich Content Types and fields, relationships link things together in a way that provides unique value to your end users. Then this wonderful data is hidden away as soon you you save the page and HTML is generated. Schema.org integration within Drupal 8 uncovers these hidden "things" and relationships and describes them as rich data within your HTML.    So, that sounds great, right? But why would you want to do this? Schema.org was created by the largest search engines in the world Google, Bing, Yahoo and Yandex. They are consuming this data to provide end users with a much richer and more relevant search experience. Google has stated that 15% of all websites it has indexed use schema.org. That adds up to ... A LOT :)    SEO is no longer a dark art. SEO is about encoding the rich relationships and entities from your website and sharing them to the wider world.   Come to this session and hear about this wonderful new and interconnected world -- the Knowledge Graph.  

Magda Kostrzewa: How to create a custom theme in Drupal 8

In this session we will look at some of the new features that are in Drupal 8 theming as well as demonstrate how to create and configure a Drupal 8 sub-theme from Classy, the new core theme in Drupal 8.

This session is for current Drupal themers who want a glimpse into how to get started creating your own sub-theme in Drupal 8 as well as those new to Drupal who want an introduction to Drupal 8 theming.

 

Jibran Ijaz: Create your own bespoke Views Style Plugins for Drupal 8

Views in Drupal Core was the first initiative to reach feature completion in Drupal 8. Like all other core systems Views has embraced PSR , Plugin Systems, Annotations and ConfigEntities.   This session is about how Drupal 8 makes it easy and painless to create a ViewsStyle Plugin.   We'll learn:
  • How to add a custom theme to a plugin.
  • How to add a display option to a plugin.
  • How to use configuration options to customise the HTML output.
  • We'll also take a look into some contributed views style plugin modules.

 

Grab a ticket now!

Catégories: Elsewhere

Darryl Norris's Blog: Improving Drupal Administration Menu with Better Admin Menu

mar, 10/02/2015 - 11:45

The Administration Menu (admin_menu) is an amazing tool for developing and managing Drupal websites. This module is one of the most used modules in Drupal because it's really a time saver compared to the module toolbar. However, the Administration Menu lack on responsive support: in other words, this module is not responsive.
Here is an example of how the Administration Menu looks like on a mobile device:
Note By the time this article is been written Administration Menu does not have a Drupal 8 version. However, they have...Read more
Catégories: Elsewhere

lakshminp.com: The Drupal 8 plugin system - part 1

mar, 10/02/2015 - 11:12

Plugins are swappable pieces of code in Drupal 8. To see how different they are from hooks, let's take an example where we want to create a new field type.

In Drupal 7, this involves:

  1. Providing information about the field

    hook_field_info - describes the field, adds metadata like label, default formatter and widget.

    hook_field_schema - resides in the module's .install file. Specifies how the field data is stored in the database.

    hook_field_validate - validates the field content before it is persisted in the database.

    hook_field_is_empty - criteria which decides when this field is considered "empty".

  2. Describe how the field will be displayed using,

    hook_field_formatter_info - metadata about different types of formatters.

    hook_field_formatter_view - implementation of the formatters defined above, mostly spits out HTML.

  3. Define a widget for the field type.

    hook_field_widget_info - provides information about widgets. For instance, a calendar would be a widget for a date field.

    hook_field_widget_form - implements the widgets.

In Drupal 8, all the 3 steps mentioned above(field info, formatters and widgets) are 3 types of plugins.

  1. Providing information about the field.
    This is done by the FieldType plugin which extends FieldItemBase. The FieldItemBase class has schema, metadata and validation encapsulated which will need to be overriden by the developer.

  2. Field formatter.
    Implemented by extending FormatterBase.
    the viewElements() function needs to be overridden to provide a renderable array for a field value. This is similar to the hook_field_formatter_view in Drupal 7.

  3. Widgets are implemented by subclassing WidgetBase.

There is many more to creating field types than that, but that's all you need to know from a plugins perspective.

What did we gain by changing fields from being a hook based system to plugins based?
For one, the code became more encapsulated. The definition and implementation is wrapped in one place.
Another benefit we reaped by following OO principles is inheritance. Plugins are designed to be extensible. This allows us to subclass similar functionality and achieve one of the most coveted ideals of software engineering, i.e. code reuse.

In the next part, we will look at the concept of plugin discovery and some common plugin types exposed by Drupal 8 core.

Catégories: Elsewhere

Jonathan Brown: Bitcoin transaction forwarding

mar, 10/02/2015 - 08:54

Forwarding of individual Bitcoin transactions to one or more addresses is a new feature in Coin Tools.

Because it spends the outputs from the transaction that is being forwarded instead of making a regular payment from the wallet pool of unspent outputs it is not necessary to wait for confirmations before sending the new transaction. If the original transaction did not ultimately make it onto the blockchain then the forwarding transaction would also not make it onto the blockchain.

However, it is prudent to wait for 1 confirmation due to a problem called transaction malleability. When a transaction is broadcast to the Bitcoin network it has a txid to uniquely identify it. However, a mischievous actor could take the transaction and change something that wouldn't affect the digital signature but would change the txid. If this altered transaction made it onto the blockchain instead of the original version, any subsequent transactions that were referring to the original txid would be invalid.

If this were to occur it wouldn't cause money loss and it could be overcome my detecting it and then reissuing the subsequent transactions. A cleaner solution is to wait for one confirmation before spending the outputs. Once the transaction is on the blockchain it is extremely unlikely that the block would be replaced by one with an altered version of the transaction.

Transaction malleability is due to a bug in the design of Bitcoin. While it cannot now be solved completely, changes to the Bitcoin software have been made to lessen the impact of this problem.

The \Drupal\cointools_daemon\Client::forwardTransaction() method in Coin Tools allows for transactions to be forwarded to multiple addresses. Output addresses have quantities attached to them to define what ratio of the input amount is sent to each address. This is similar to how Coinsplit operates, although they wait for 3 confirmations and may do a general wallet spend instead of forwarding the specific transaction.

<?php
  /**
   * Forwards a bitcoin transaction to one or more addresses with defined
   * proportionality.
   *
   * @param $txid
   *   txid of transaction to forward.
   * @param array $addresses
   *   List of addresses that can be spent from.
   * @param array $outputs
   *   Where to forward the bitcoin to.
   *   Keys are destinations addresses.
   *   Values are proportional quantities.
   * @param bool $tx_confirm_target
   *   The fee should be calculated for the transaction to reach the blockchain
   *   after this many blocks. default = 1
   *
   * @return string
   *   txid of the forwarding transaction.
   */
  public function forwardTransaction($txid, array $addresses, array $outputs, $tx_confirm_target = 1) {
    $transaction_in = $this->transactionLoad($txid);
    // Find inputs and amount for new transaction.
    $inputs = [];
    $transaction_amount = 0;
    foreach ($transaction_in['vout'] as $vout) {
      // Is this output for one of our addresses?
      if (in_array($vout['scriptPubKey']['addresses'][0], $addresses)) {
        // Has this output been spent yet?
        try {
          $this->request('gettxout', [$txid, $vout['n']]);
          $inputs[] = [
            'txid' => $txid,
            'vout' => $vout['n'],
          ];
          $transaction_amount += CoinTools::bitcoinToSatoshi($vout['value']);
        }
        catch (\Exception $e) {}
      }
    }
    // Remove the miner fee from the transaction amount.
    $transaction_amount -= $this->transactionEstimateFee(count($inputs), count($outputs));
    // Divide up the pie according to the correct proportions.
    $ratio = $transaction_amount / array_sum($outputs);
    foreach ($outputs as $address => &$amount) {
      $amount *= $ratio;
      // Eliminate dust outputs.
      if ($amount < 546) {
        unset($outputs[$address]);
        continue;
      }
      $amount = CoinTools::satoshiToBitcoin($amount);
    }
    // Make sure there is something to send.
    if (empty($outputs)) {
      throw new \Exception("No bitcoin to send.");
    }
    // Send the transaction.
    return $this->transactionSendNew($inputs, $outputs);
  }
?>

What are the use cases of transaction forwarding?

Splitting donations among different parties

If a band was getting paid in Bitcoin it could be configured what percentage each band member would receive.

Affiliate marketing

When a sale is made, a third party who provided the lead for the sale could receive part of the funds spent.

Donate percent of revenue to charity

A company could provably show that they are donating a certain percentage of their revenue to a charity. If the funds are always forwarded to the same address for the charity, then a customer can observe the blockchain and check that the correct proportion of their money went to the right place.

Getting funds off an insecure platform

As I mentioned in an earlier blog post, holding funds in a hot-wallet on a server is not very secure. Immediately forwarding the transactions out of harms way alleviates this problem.

I have added support for this to Coin Tools payments. If the forwarding address is set in the payment type, payments will be forwarded to it after 1 confirmation.

An example of this can be seen on the blockchain.

Catégories: Elsewhere

DrupalCon News: DrupalCon LA 2015 - get involved with the Coding and Development track

lun, 09/02/2015 - 19:14

Implements hook_awesome() has been deprecated, use $Drupal->awesome().

Catégories: Elsewhere

Tag1 Consulting: When All Else Fails, Reflect on the Fail

lun, 09/02/2015 - 17:49

While coding the MongoDB integration for Drupal 8 I hit a wall first with the InstallerKernel which was easy to remedy with a simple core patch but then a similar problem occurred with the TestRunnerKernel and that one is not so simple to fix: these things were not made with extensibility in mind. You might hit some other walls -- the code below is not MongoDB specific. But note how unusual this is: you won’t hit similar problems often. Drupal 8 very extensible but it has its limits.

read more

Catégories: Elsewhere

Dcycle: Drupal and Docker: Creating a new Docker image based on an existing image

lun, 09/02/2015 - 15:26

To get the most of this blog post, please read and understand Getting Started with Docker (Servers for Hackers, 2014/03/20). Also, all the steps outlined here have been done on a Vagrant CoreOS virtual machine (VM).

I recently needed a really simple non-production Drupal Docker image on which I could run tests. d7alt/drupal (which you can find by typing docker search drupal, or on GitHub) worked for my needs, except that it did not have the cUrl php library installed, so drush en simpletest -y was throwing an error.

Therefore, I decided to create a new Docker image which is based on d7alt/drupal, but with the php5-curl library installed.

I started by creating a new local directory (on my CoreOS VM), which I called docker-drupal:

mkdir docker-drupal

In that directory, I created Dockerfile which takes d7alt/drupal as its base, and runs apt-get install curl.

FROM b7alt/drupal RUN apt-get update RUN apt-get -y install curl

(You can find this code at my GitHub account at alberto56/docker-drupal.)

When you run this you will get:

docker build . ... Successfully built 55a8c8999520

That hash is a Docker image ID, and your hash might be different. You can run it and see if it works as expected:

docker run -d 55a8c8999520 c9a98bdcab4e027e8571bde71ee92b4380247a44ef9314749ef5680864de2928

In the above, we are telling Docker to create a container based on the image we just created (55a8c8999520). The resulting container hash is displayed (yours might be different). We are using -d so that our containers runs in the background. You can see that the container is actually running by typing:

docker ps CONTAINER ID IMAGE COMMAND... c9a98bdcab4e 55a8c8999520 "/usr/bin/supervisor...

This tells you that there is a running container (c9a98bdcab4e) based on the image 55a8c8999520. Again, your hases will be different. Let's log into that container now:

docker exec -it c9a98bdcab4e bash root@c9a98bdcab4e:/#

To make sure that cUrl is successfully installed, I will figure out where Drupal resides on this container, and then try to enable Simpletest. If that works, I will consider my image a success, and exit from my container:

root@c9a98bdcab4e:/# find / -name 'index.php' /srv/drupal/www/index.php root@c9a98bdcab4e:/# cd /srv/drupal/www root@c9a98bdcab4e:/srv/drupal/www# drush en simpletest -y The following extensions will be enabled: simpletest Do you really want to continue? (y/n): y simpletest was enabled successfully. [ok] root@c9a98bdcab4e:/srv/drupal/www# exit exit

Now I know that my 55a8c8999520 image is good for now and for my purposes; I can create an account on Docker.com and push it to my account for later use:

Docker build -t alberto56/docker-drupal . docker push alberto56/docker-drupal

Anyone can now run this Docker image by simply typing:

docker run alberto56/docker-drupal

One thing I had a hard time getting my head around was having a GitHub project and Docker project, and both are different but linked. The GitHub project is the the recipe for creating an image, whereas the Docker project is the image itself.

One we start thinking of our environments like this (as entities which should be versioned and shared), the risk of differences between environments is greatly reduced. I was used to running simpletests for my projects on an environment which is managed by hand; when I got a strange permissions error on the test environment, I decided to start using Docker and version control to manage the container where tests are run.

Tags: blogplanet
Catégories: Elsewhere

Pages