Elsewhere

Drupalize.Me: Learn Views in Drupal 8

Planet Drupal - lun, 20/06/2016 - 16:44

One of the big changes in Drupal 8 is that Views, the most popular contributed module in Drupal 7, is now included as part of core. Learning Views is a key component of learning to build Drupal sites. Aside from having this tool built in core now, the beauty of this new feature is that it is almost identical to Views in Drupal 7. You can get started site-building with Views in Drupal 8 without waiting for any fancy version-specific instructions.

Catégories: Elsewhere

Mediacurrent: Dropcast: Episode 21- Finally Oscar Menjivar

Planet Drupal - lun, 20/06/2016 - 16:00

This episode we celebrate our fine podcast finally coming of drinking age and finally get our act together to welcome Oscar Menjivar back, again, for a third time, to talk about his project Exploring Tech which helps youths in south central LA learn how to develop technology. As always we have the latest Drupal news, Bob talks about the most recent Mediacurrent blog posts and Ryan rings us home with the final bell.

Catégories: Elsewhere

Liip: Let’s debug in Drupal 8 !

Planet Drupal - lun, 20/06/2016 - 09:01

It has been nearly 7 months since Drupal 8 first release and as a developer, I am still in the learning process. It can be hard sometimes to know what is going wrong with your code and how to solve it. I will tell you about few things to know on how to develop and debug Drupal 8 projects and continue learning, learning and learning !

Disabling cache

First of all, to avoid having a crazy terminal with thousands of drupal cr hits, you can disable Drupal caching during development. You need to copy and rename sites/example.settings.local.php file to sites/default/settings.local.php. Then uncomment/update some values:

  • uncomment this line to enable the “null cache service”:
    $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
  • uncomment these lines to disable CSS/JS aggregation:
    $config['system.performance']['css']['preprocess'] = FALSE; $config['system.performance']['js']['preprocess'] = FALSE;
  • uncomment these lines to disable the render cache and the dynamic page cache:
    $settings['cache']['bins']['render'] = 'cache.backend.null'; $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
  • you can allow test modules and themes to be installed if needed with:
    $settings['extension_discovery_scan_tests'] = TRUE;

To include this file as part of Drupal’s settings file, open sites/default/settings.php file and uncomment these lines:

if (file_exists(__DIR__ . '/settings.local.php')) { include __DIR__ . '/settings.local.php'; }

Then, to disable Twig caching, open sites/development.services.yml file and add the following settings:

parameters: twig.config: debug: true auto_reload: true cache: false

Finally, rebuild the Drupal cache and it is done !

Displaying errors

As in Drupal 7, you can set different levels of errors display (by visiting this page: /admin/config/development/logging in the administration interface):

  • None
  • Errors and warnings
  • All

In Drupal 8, there is a fourth level called “All messages, with backtrace information”. This is native to Drupal core and it allows to display the error backtrace in the message area.

You can also adjust the level of errors in your local setting file:

$config['system.logging']['error_level'] = 'verbose';

Creating log messages

Developers from Drupal 7 know the Database Logging module that allows to log messages in the database using the famous watchdog() function.
Well, this module still exists in Drupal 8 but the function has a replacement : the Drupal 8 logger class.
It looks like this:

// Logs an error \Drupal::logger('my_module')->error($message);

Let’s have a look at the different parts of the code:

  • \Drupal::logger(‘my_module’) is the helper method that quickly creates a copy of the logger service. As a parameter, it takes the module name from where we log the information;
  • ->error: this is the severity-level method (it can be debug, info, notice, warning, error, critical, alert, emergency);
  • $message is the log message. It can be a simple string or it can contain some placeholders. In this case, you can pass the associative array (placeholders as keys) as a second parameter.

All the messages created with the logger service can be viewed in the reports page of the administration interface in /admin/reports/dblog as it used to be in Drupal 7.

Debugging Twig templates

Drupal core comes with a theming debug mode that is really helpful for local environments. To enable it, copy-and-paste the following code into sites/default/services.yml file (if you haven’t already added these lines in development.services.yml):

parameters: twig.config: debug: true

Thanks to this mode, it will be easier to find out which portion of HTML code has been written in which templates: in the source code, you will see each part of Twig templates (pages, nodes, blocks, menus etc.) surrounded by HTML comments that contain the matching suggestion templates. The one in current use will be checked.
Make sure to enable comments in your web browser debug tab and also note that this feature has been backported to Drupal 7.

Used templates mentioned in HTML comments

Inside a Twig template, you will also be able to use {{ dump(my_variable) }} syntax to print a variable content.
If you have Devel Kint module installed, you can use {{ kint(my_variable) }} to dump the variable in a nice formatted structure: you can hide/show levels of arrays/objects which is very helpful as Drupal variables can have many levels inside. Kint is indeed the successor of the krumo() function from Drupal 7.

Print content_attributes variable with kint from node.html.twig template

Profiling pages

When dealing with performance issues, profiling a website will help finding what is the root cause.
The well-known debugging module Devel offers in its latest version a Webprofiler. It is actually a (partial) port of the Symfony profiler and it displays a footer bar on every page with useful data collectors such as:

  • Drupal current version;
  • PHP configuration (current version, loaded modules);
  • route and controller name;
  • page load timeline and memory use;
  • query time and number of queries;
  • number of blocks loaded and rendered;
  • number of views;
  • number of modules and themes available;
  • cache statistics.

Webprofiler bar in Drupal 8

By clicking on each section, you will be redirected to a specific page with more details about the collected data. For instance, if you look at the page request details, you will see which was the matching route, the route object with the passed parameters, response headers etc. Well, all the information needed to debug requests.

Details of a page request provided by Webprofiler

Using command line tools

The Drupal Console project is a powerful command line tool that makes use of the Symfony Console and other third-party components. It is complementary to Drush and allows you to generate code to build modules and themes (code scaffolding), to interact with your Drupal installation and help to debug your code.

Once the Drupal Console installed, you can run the drupal list command to show all available commands.

Here are some useful commands for debug:

  • drupal check: check system requirements;
  • drupal site:status: show current Drupal installation status (Versions of Drupal, PHP, MySQL and libraries, updates status, cron last run, database connection etc.);
  • drupal database:table:debug: show all tables of the database;
  • drupal database:table:debug my_table: show columns of my_table table;
  • drupal config:debug: list all configurations;
  • drupal config:debug image.settings: show configuration for image.settings;
  • drupal config:settings:debug: display current key:value from the settings file;
  • drupal container:debug: display all services ID with the matching class name;
  • drupal router:debug: display all route names with the matching paths;
  • drupal router:debug dblog.overview: display route information about dblog overview page;
  • drupal database:log:debug: display current log events;
  • drupal database:log:debug 107: display one log event in details;
  • drupal site:statistics: show some statistics about the website (number of modules enabled/disabled, number of users and comments etc.).

The Drupal Console is already used by many companies well known in the Drupal community such as Acquia, Amazee Labs, Phase2 and Commerce Guys and is becoming the standard command line tool for Drupal 8.
But note that the current version is not yet fully compatible with Drupal 8.1.x, for instance, there are still some issues with migration commands. The team of the project is currently looking for some financial support and more contributors to get a full stable release.

For more information about the project, check out the official website and the documentation.

Catégories: Elsewhere

Kevin Avignon: Become better, learn better, do code katas !

Planet Debian - dim, 19/06/2016 - 18:46
Hey guys Today, I’m here talking about how to better ourselves us developers. We’re always learning while working and that’s bad. We should instead learn in our own time and practice before trying to use our tools to resolve the bugs in the software and the features requests from the clients. Learning on the job … Continue reading Become better, learn better, do code katas ! →
Catégories: Elsewhere

Paul Tagliamonte: Go Debian!

Planet Debian - dim, 19/06/2016 - 18:30

As some of the world knows full well by now, I've been noodling with Go for a few years, working through its pros, its cons, and thinking a lot about how humans use code to express thoughts and ideas. Go's got a lot of neat use cases, suited to particular problems, and used in the right place, you can see some clear massive wins.

Some of the things Go is great at: Writing a server. Dealing with asynchronous communication. Backend and front-end in the same binary. Fast and memory safe. Things Go is bad at: Having to rebuild everything for a CVE. Having if `err != nil` everywhere. "Better than C" being the excuse for bad semantics. No generics, cgo (enough said)

I've started writing Debian tooling in Go, because it's a pretty natural fit. Go's fairly tight, and overhead shouldn't be taken up by your operating system. After a while, I wound up hitting the usual blockers, and started to build up abstractions. They became pretty darn useful, so, this blog post is announcing (a still incomplete, year old and perhaps API changing) Debian package for Go. The Go importable name is pault.ag/go/debian. This contains a lot of utilities for dealing with Debian packages, and will become an edited down "toolbelt" for working with or on Debian packages.

Module Overview

Currently, the package contains 4 major sub packages. They're a changelog parser, a control file parser, deb file format parser, dependency parser and a version parser. Together, these are a set of powerful building blocks which can be used together to create higher order systems with reliable understandings of the world.

changelog

The first (and perhaps most incomplete and least tested) is a changelog file parser.. This provides the programmer with the ability to pull out the suite being targeted in the changelog, when each upload was, and the version for each. For example, let's look at how we can pull when all the uploads of Docker to sid took place:

func main() { resp, err := http.Get("http://metadata.ftp-master.debian.org/changelogs/main/d/docker.io/unstable_changelog") if err != nil { panic(err) } allEntries, err := changelog.Parse(resp.Body) if err != nil { panic(err) } for _, entry := range allEntries { fmt.Printf("Version %s was uploaded on %s\n", entry.Version, entry.When) } }

The output of which looks like:

Version 1.8.3~ds1-2 was uploaded on 2015-11-04 00:09:02 -0800 -0800 Version 1.8.3~ds1-1 was uploaded on 2015-10-29 19:40:51 -0700 -0700 Version 1.8.2~ds1-2 was uploaded on 2015-10-29 07:23:10 -0700 -0700 Version 1.8.2~ds1-1 was uploaded on 2015-10-28 14:21:00 -0700 -0700 Version 1.7.1~dfsg1-1 was uploaded on 2015-08-26 10:13:48 -0700 -0700 Version 1.6.2~dfsg1-2 was uploaded on 2015-07-01 07:45:19 -0600 -0600 Version 1.6.2~dfsg1-1 was uploaded on 2015-05-21 00:47:43 -0600 -0600 Version 1.6.1+dfsg1-2 was uploaded on 2015-05-10 13:02:54 -0400 EDT Version 1.6.1+dfsg1-1 was uploaded on 2015-05-08 17:57:10 -0600 -0600 Version 1.6.0+dfsg1-1 was uploaded on 2015-05-05 15:10:49 -0600 -0600 Version 1.6.0+dfsg1-1~exp1 was uploaded on 2015-04-16 18:00:21 -0600 -0600 Version 1.6.0~rc7~dfsg1-1~exp1 was uploaded on 2015-04-15 19:35:46 -0600 -0600 Version 1.6.0~rc4~dfsg1-1 was uploaded on 2015-04-06 17:11:33 -0600 -0600 Version 1.5.0~dfsg1-1 was uploaded on 2015-03-10 22:58:49 -0600 -0600 Version 1.3.3~dfsg1-2 was uploaded on 2015-01-03 00:11:47 -0700 -0700 Version 1.3.3~dfsg1-1 was uploaded on 2014-12-18 21:54:12 -0700 -0700 Version 1.3.2~dfsg1-1 was uploaded on 2014-11-24 19:14:28 -0500 EST Version 1.3.1~dfsg1-2 was uploaded on 2014-11-07 13:11:34 -0700 -0700 Version 1.3.1~dfsg1-1 was uploaded on 2014-11-03 08:26:29 -0700 -0700 Version 1.3.0~dfsg1-1 was uploaded on 2014-10-17 00:56:07 -0600 -0600 Version 1.2.0~dfsg1-2 was uploaded on 2014-10-09 00:08:11 +0000 +0000 Version 1.2.0~dfsg1-1 was uploaded on 2014-09-13 11:43:17 -0600 -0600 Version 1.0.0~dfsg1-1 was uploaded on 2014-06-13 21:04:53 -0400 EDT Version 0.11.1~dfsg1-1 was uploaded on 2014-05-09 17:30:45 -0400 EDT Version 0.9.1~dfsg1-2 was uploaded on 2014-04-08 23:19:08 -0400 EDT Version 0.9.1~dfsg1-1 was uploaded on 2014-04-03 21:38:30 -0400 EDT Version 0.9.0+dfsg1-1 was uploaded on 2014-03-11 22:24:31 -0400 EDT Version 0.8.1+dfsg1-1 was uploaded on 2014-02-25 20:56:31 -0500 EST Version 0.8.0+dfsg1-2 was uploaded on 2014-02-15 17:51:58 -0500 EST Version 0.8.0+dfsg1-1 was uploaded on 2014-02-10 20:41:10 -0500 EST Version 0.7.6+dfsg1-1 was uploaded on 2014-01-22 22:50:47 -0500 EST Version 0.7.1+dfsg1-1 was uploaded on 2014-01-15 20:22:34 -0500 EST Version 0.6.7+dfsg1-3 was uploaded on 2014-01-09 20:10:20 -0500 EST Version 0.6.7+dfsg1-2 was uploaded on 2014-01-08 19:14:02 -0500 EST Version 0.6.7+dfsg1-1 was uploaded on 2014-01-07 21:06:10 -0500 EST control

Next is one of the most complex, and one of the oldest parts of go-debian, which is the control file parser (otherwise sometimes known as deb822). This module was inspired by the way that the json module works in Go, allowing for files to be defined in code with a struct. This tends to be a bit more declarative, but also winds up putting logic into struct tags, which can be a nasty anti-pattern if used too much.

The first primitive in this module is the concept of a Paragraph, a struct containing two values, the order of keys seen, and a map of string to string. All higher order functions dealing with control files will go through this type, which is a helpful interchange format to be aware of. All parsing of meaning from the Control file happens when the Paragraph is unpacked into a struct using reflection.

The idea behind this strategy that you define your struct, and let the Control parser handle unpacking the data from the IO into your container, letting you maintain type safety, since you never have to read and cast, the conversion will handle this, and return an Unmarshaling error in the event of failure.

I'm starting to think parsing and defining the control structs are two different tasks and should be split apart -- or the common structs ought to be removed entirely. More on this later.

Additionally, Structs that define an anonymous member of control.Paragraph will have the raw Paragraph struct of the underlying file, allowing the programmer to handle dynamic tags (such as X-Foo), or at least, letting them survive the round-trip through go.

The default decoder contains an argument, the ability to verify the input control file using an OpenPGP keyring, which is exposed to the programmer through the (*Decoder).Signer() function. If the passed argument is nil, it will not check the input file signature (at all!), and if it has been passed, any signed data must be found or an error will fall out of the NewDecoder call. On the way out, the opposite happens, where the struct is introspected, turned into a control.Paragraph, and then written out to the io.Writer.

Here's a quick (and VERY dirty) example showing the basics of reading and writing Debian Control files with go-debian.

package main import ( "fmt" "io" "net/http" "strings" "pault.ag/go/debian/control" ) type AllowedPackage struct { Package string Fingerprint string } func (a *AllowedPackage) UnmarshalControl(in string) error { in = strings.TrimSpace(in) chunks := strings.SplitN(in, " ", 2) if len(chunks) != 2 { return fmt.Errorf("Syntax sucks: '%s'", in) } a.Package = chunks[0] a.Fingerprint = chunks[1][1 : len(chunks[1])-1] return nil } type DMUA struct { Fingerprint string Uid string AllowedPackages []AllowedPackage `control:"Allow" delim:","` } func main() { resp, err := http.Get("http://metadata.ftp-master.debian.org/dm.txt") if err != nil { panic(err) } decoder, err := control.NewDecoder(resp.Body, nil) if err != nil { panic(err) } for { dmua := DMUA{} if err := decoder.Decode(&dmua); err != nil { if err == io.EOF { break } panic(err) } fmt.Printf("The DM %s is allowed to upload:\n", dmua.Uid) for _, allowedPackage := range dmua.AllowedPackages { fmt.Printf(" %s [granted by %s]\n", allowedPackage.Package, allowedPackage.Fingerprint) } } }

Output (truncated!) looks a bit like:

... The DM Allison Randal <allison@lohutok.net> is allowed to upload: parrot [granted by A4F455C3414B10563FCC9244AFA51BD6CDE573CB] ... The DM Benjamin Barenblat <bbaren@mit.edu> is allowed to upload: boogie [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B] dafny [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B] transmission-remote-gtk [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B] urweb [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B] ... The DM أحمد المحمودي <aelmahmoudy@sabily.org> is allowed to upload: covered [granted by 41352A3B4726ACC590940097F0A98A4C4CD6E3D2] dico [granted by 6ADD5093AC6D1072C9129000B1CCD97290267086] drawtiming [granted by 41352A3B4726ACC590940097F0A98A4C4CD6E3D2] fonts-hosny-amiri [granted by BD838A2BAAF9E3408BD9646833BE1A0A8C2ED8FF] ... ... deb

Next up, we've got the deb module. This contains code to handle reading Debian 2.0 .deb files. It contains a wrapper that will parse the control member, and provide the data member through the archive/tar interface.

Here's an example of how to read a .deb file, access some metadata, and iterate over the tar archive, and print the filenames of each of the entries.

func main() { path := "/tmp/fluxbox_1.3.5-2+b1_amd64.deb" fd, err := os.Open(path) if err != nil { panic(err) } defer fd.Close() debFile, err := deb.Load(fd, path) if err != nil { panic(err) } version := debFile.Control.Version fmt.Printf( "Epoch: %d, Version: %s, Revision: %s\n", version.Epoch, version.Version, version.Revision, ) for { hdr, err := debFile.Data.Next() if err == io.EOF { break } if err != nil { panic(err) } fmt.Printf(" -> %s\n", hdr.Name) } }

Boringly, the output looks like:

Epoch: 0, Version: 1.3.5, Revision: 2+b1 -> ./ -> ./etc/ -> ./etc/menu-methods/ -> ./etc/menu-methods/fluxbox -> ./etc/X11/ -> ./etc/X11/fluxbox/ -> ./etc/X11/fluxbox/window.menu -> ./etc/X11/fluxbox/fluxbox.menu-user -> ./etc/X11/fluxbox/keys -> ./etc/X11/fluxbox/init -> ./etc/X11/fluxbox/system.fluxbox-menu -> ./etc/X11/fluxbox/overlay -> ./etc/X11/fluxbox/apps -> ./usr/ -> ./usr/share/ -> ./usr/share/man/ -> ./usr/share/man/man5/ -> ./usr/share/man/man5/fluxbox-style.5.gz -> ./usr/share/man/man5/fluxbox-menu.5.gz -> ./usr/share/man/man5/fluxbox-apps.5.gz -> ./usr/share/man/man5/fluxbox-keys.5.gz -> ./usr/share/man/man1/ -> ./usr/share/man/man1/startfluxbox.1.gz ... dependency

The dependency package provides an interface to parse and compute dependencies. This package is a bit odd in that, well, there's no other library that does this. The issue is that there are actually two different parsers that compute our Dependency lines, one in Perl (as part of dpkg-dev) and another in C (in dpkg).

I have yet to track it down, but it's shockingly likely that `apt` has another in `C++`, and maybe another in `aptitude`. I don't know this for a fact, so I'll assume nothing

To date, this has resulted in me filing three different bugs. I also found a broken package in the archive, which actually resulted in another bug being (totally accidentally) already fixed. I hope to continue to run the archive through my parser in hopes of finding more bugs! This package is a bit complex, but it basically just returns what amounts to be an AST for our Dependency lines. I'm positive there are bugs, so file them!

func main() { dep, err := dependency.Parse("foo | bar, baz, foobar [amd64] | bazfoo [!sparc], fnord:armhf [gnu-linux-sparc]") if err != nil { panic(err) } anySparc, err := dependency.ParseArch("sparc") if err != nil { panic(err) } for _, possi := range dep.GetPossibilities(*anySparc) { fmt.Printf("%s (%s)\n", possi.Name, possi.Arch) } }

Gives the output:

foo (<nil>) baz (<nil>) fnord (armhf) version

Right off the bat, I'd like to thank Michael Stapelberg for letting me graft this out of dcs and into the go-debian package. This was nearly entirely his work (with a one or two line function I added later), and was amazingly helpful to have. Thank you!

This module implements Debian version comparisons and parsing, allowing for sorting in lists, checking to see if it's native or not, and letting the programmer to implement smart(er!) logic based on upstream (or Debian) version numbers.

This module is extremely easy to use and very straightforward, and not worth writing an example for.

Final thoughts

This is more of a "Yeah, OK, this has been useful enough to me at this point that I'm going to support this" rather than a "It's stable!" or even "It's alive!" post. Hopefully folks can report bugs and help iterate on this module until we have some really clean building blocks to build solid higher level systems on top of. Being able to have multiple libraries interoperate by relying on go-debian will be a massive ease. I'm in need of more documentation, and to finalize some parts of the older sub package APIs, but I'm hoping to be at a "1.0" real soon now.

Catégories: Elsewhere

Lars Wirzenius: New APT signing key for code.liw.fi/debian

Planet Debian - dim, 19/06/2016 - 12:51

For those who use my code.liw.fi/debian APT repository, please be advised that I've today replaced the signing key for the repository. The new key has the following fingerprint:

8072 BAD4 F68F 6BE8 5F01 9843 F060 2201 12B6 1C1F

I've signed the key with my primary key and sent the new key with signature to the key servers. You can also download it at http://code.liw.fi/apt.asc.

Catégories: Elsewhere

Vardot: Facebook Comments Block

Planet Drupal - dim, 19/06/2016 - 12:49
Resources Read time: 5 minutes

In this article I’d like to share with you a module that I’ve recently created for Drupal 7 and 8 called Facebook Comments Block. It gives visitors of your website the opportunity to comment on your site’s content using a widget that is directly integrated with Facebook. Here is the screenshot showing you how the commenting box will be displayed on your website:

 

 

What was missing in other Drupal commenting modules?

The historical background of my contribution to the Drupal society was pretty easy. While working on Vardot’s distribution Uber Publisher our main goal was to make Drupal as user-friendly as possible. One of the increasing users’ convenience factors was a maximal easiness in adding comments on the website, and one of the main satisfaction criterias from the user's perspective is the number of clicks and the total time needed to proceed with a request.

The big UX disadvantage of popular solutions is that users are required to create an account on a new website. The number of services we are using is increasing every year, and managing, remembering passwords or even logging in to all of them becomes very time-consuming. As a site visitor I’d prefer to be able to comment on posts without signing up, because otherwise, if I read several blogs, I waste too much time for nothing.

Another important disadvantage of commenting widgets I worked with (this time more for a developer and site owner than for an end-user) was that most of them were based on URL aliases. As a result some of our clients were facing the issue when they were losing all comments after changing the URL of the page or its title (in Uber Publisher short SEO-friendly URLs are generated automatically based on the title of the post).

 

What are the advantages of Facebook Comments Block module?

Addressing issues that were described above, and adding some new benefits, I’ve made a list of reasons why you may go for the Facebook Comments Block module:

 

  1. Facebook Comments Block relies on a node ID

The widget minimizes risks of changing the URL, because it relies on a node ID that is always constant. As a result, even if you rewrite the title of your article or the link of the page, comments that were added before won’t be lost.

 

  1. Facebook Comments Block allows for the main domain configuration

If you have multiple domains associated with your website, you can configure the module to recognize the main domain and share comments across all domains. For example, we have two URLs for the same site - www.example.com/article-title and www.myexample.com/article-title. Configure Facebook Comments Block to use www.example.com as a main domain, and comments of the main domain will be shared to and from www.myexample.com.

 

  1. Facebook Comments Block uses basic configurations

It doesn’t have dependencies which makes it easy to install and use. Just go to "Admin" -> "Structure" -> "Block", and you’ll find "Facebook Comments" settings. Choosing “Configure” you’ll see the menu with options to customize the widget:

 

 

  1. You don’t need to log in

Most of the site visitors are already logged in with their Facebook profiles. As a result, they comment using their real social media (Facebook) account and don’t need to make additional clicks to be able to comment. The idea of this widget is to be organically implemented to the page and be percepted as its natural part, so the visitor doesn’t even realize that there is a special block for commenting that is connected to an external service.

 

  1. Facebook Comments Block is easy to integrate with other modules

The widget uses Drupal block API, so it can be easily integrated with most of the Drupal modules that support blocks (i.e. Rules, Context, Panels, …etc.). The integration is straightforward and doesn’t require any additional development efforts or customization.

 

Porting Facebook Comments Block to Drupal 8

Facebook Comments Block was a new step in my developer’s career, because it introduced me to the world of Drupal 8. After D8 release I’ve decided to learn it by porting this block, and use Drupal 8’s new block API, block configurations and the new twig templates to apply changes to my new module. Now the widget is available in two latest Drupal versions - D7 and D8. It can be used by site owners that already realized benefits of Drupal 8 as well as by site owners that prefer to wait, evaluate, and choose.

 

Bottom line

The usage statistics of the widget shows that the number of people installing it is constantly growing and reached 380 sites by the beginning of June:

 

 

Drupal modules are developed by community and grown by community. If you’d like to try the Facebook Comments Block, feel free to download it from drupal.org. To report any bug issue, support or feature request you can fill a new ticket on Drupal issue queue. And of course I would be really thankful if you share this blog post in your social networks, so more interested people could learn about the widget and try it out.

  Tags:  Drupal Planet drupal 8 Modules Title:  Facebook Comments Block
Catégories: Elsewhere

Elena 'valhalla' Grandi: StickerConstructorSpec compliant swirl

Planet Debian - dim, 19/06/2016 - 10:15
StickerConstructorSpec compliant swirl

This evening I've played around a bit with the Sticker Constructor Specification https://github.com/terinjokes/StickerConstructorSpec and its https://github.com/terinjokes/StickerConstructorSpec/blob/master/assets/hexagonal-sticker_template.svg, and this is the result:

http://social.gl-como.it/photos/valhalla/image/e8ee069635b2823e168c358d2a753f14


Now I just have to:

* find somebody in Europe who prints good stickers and doesn't require illustrator (or other proprietary software) to submit files for non-rectangular shapes
* find out which Debian team I should contact to submit the files so that they can be used by everybody interested.

But neither will happen today, nor probably tomorrow, because lazy O:-)

Edit: now that I'm awake I realized I forgot to thank @Enrico Zini Zini and MadameZou for their help in combining my two proposals in a better design.

Source svg http://social.gl-como.it/attach/3
Catégories: Elsewhere

Debian Java Packaging Team: Wheezy LTS and the switch to OpenJDK 7

Planet Debian - dim, 19/06/2016 - 00:00

Wheezy's LTS period started a few weeks ago and the LTS team had to make an early support decision concerning the Java eco-system since Wheezy ships two Java runtime environments OpenJDK 6 and OpenJDK 7. (To be fair, there are actually three but gcj has been superseded by OpenJDK a long time ago and the latter should be preferred whenever possible.)

OpenJDK 6 is currently maintained by Red Hat and we mostly rely on their upstream work as well as on package updates from Debian's maintainer Matthias Klose and Tiago Stürmer Daitx from Ubuntu. We already knew that both intend to support OpenJDK 6 until April 2017 when Ubuntu 12.04 will reach its end-of-life. Thus we had basically two options, supporting OpenJDK 6 for another twelve months or dropping support right from the start. One of my first steps was to ask for feedback and advice on debian-java since supporting only one JDK seemed to be the more reasonable solution. We agreed on warning users via various channels about the intended change, especially about possible incompatibilities with OpenJDK 7. Even Andrew Haley, OpenJDK 6 project lead, participated in the discussion and confirmed that, while still supported, OpenJDK 6 security releases are "always the last in the queue when there is urgent work to be done".

I informed debian-lts about my findings and issued a call for tests later.

Eventually we decided to concentrate our efforts on OpenJDK 7 because we are confident that for the majority of our users one Java implementation is sufficient during a stable release cycle. An immediate positive effect in making OpenJDK 7 the default is that resources can be relocated to more pressing issues. On the other hand we were also forced to make compromises. The switch to a newer default implementation usually triggers a major transition with dozens of FTBFS bugs and the OpenJDK 7 transition was no exception. I pondered about the usefulness of fixing all these bugs for Wheezy LTS again and focussing on runtime issues instead and finally decided that the latter was both more reasonable and more economic.

Different from regular default Java changes, users will still be able to use OpenJDK 6 to compile their packages and the security impact for development systems is in general neglectable. More important was to avoid runtime installations of OpenJDK 6. I identified eighteen packages that strictly depended on the now obsolete JRE and fixed those issues on 4 May 2016 together with an update of java-common and announced the switch to OpenJDK 7 with a Debian NEWS file.

If you are not a regular reader of Debian news and also not subscribed to debian-lts, debian-lts-announce or debian-java, remember 26 June 2016 is the day when OpenJDK 7 will be made the default Java implementation in Wheezy LTS. Of course there is no need to wait. You can switch right now:

sudo update-alternatives --config java
Catégories: Elsewhere

Dominique Dumont: An improved Perl API for cme and Config::Model

Planet Debian - sam, 18/06/2016 - 19:38

Hello

While hacking on a script to update build dependencies on a Debian package, it occured to me that using Config::Model in a Perl program should be no more complicated than using cme from a shell script. That was an itch that I scratched immediately.

Fast forward a few days, Config::Model now features new cme() and modify() functions that have a behavior similar to cme modify command.

For instance, the following program is enough to update popcon’s configuration file:

use strict; # let's not forget best practices ;-) use warnings; use Config::Model qw(cme); # cme function must be imported cme('popcon')->modify("PARTICIPATE=yes");

The object returned by cme() is a Config;:Model::Instance. All its methods are available for a finer control. For instance:

my $instance = cme('popcon'); $instance->load("PARTICIPATE=yes"); $instance->apply_fixes; $instance->say_changes; $instance->save;

When run as root, the script above shows:

Changes applied to popcon configuration: - PARTICIPATE: 'no' -> 'yes'

If need be, you can also retrieve the root node of the configuration tree to use Config;:Model::Node methods:

my $root_node = cme('popcon')->config_root; say "is popcon active ? ",$root_node->fetch_element_value('PARTICIPATE');

In summary, using cme in a Perl program is now as easy as using cme from a shell script.

To provide feedback, comments, ideas, patches or to report problems, please follow the instructions from CONTRIBUTING page on github.

All the best


Tagged: config-model, configuration, Perl
Catégories: Elsewhere

Manuel A. Fernandez Montecelo: More work on aptitude

Planet Debian - sam, 18/06/2016 - 18:54

The last few months have been a bit of a crazy period of ups and downs, with a tempest of events beneath the apparent and deceivingly calm surface waters of being unemployed (still at it).

The daily grind

Chief activities are, of course, those related to the daily grind of job-hunting, sending applications, and preparing and attending interviews.

It is demoralising when one searches for many days or weeks without seeing anything suitable for one's skills or interests, or other more general life expectations. And it takes a lot of time and effort to put one's best in the applications for positions that one is really, really, interested in. And even for the ones which are meh, for a variety of reasons (e.g. one is not very suitable for what the offer demands).

After that, not being invited to interviews (or doing very badly at them) is bad, of course, but quick and not very painful. A swift, merciful end to the process.

But it's all the more draining when waiting for many weeks ─when not a few months─ with the uncertainty of not knowing if one is going to be lucky enough to be summoned for an interview; harbouring some hope ─one has to appear enthusiastic in the interviews, after all─, while trying to keep it contained ─lest it grows too much─; then in the interview hearing good words and some praises, and feeling the impression that one will fit in, that one did nicely and that chances are good ─letting the hope grow again─; start to think about life changes that the job will require ─to make a quick decision should the offer finally arrives─; perhaps make some choices and compromises based on the uncertain result; then wait for a week or two after the interview to know the result...

... only to end up being unsuccessful.

All the effort and hopes finally get squashed with a cold, short email or automatic response, or more often than not, complete radio silence from prospective employers, as an end to a multi-month-long process. An emotional roller coaster [1], which happened to me several times in the last few months.

All in a day's work

The months of preparing and waiting for a new job often imply an impasse that puts many other things that one cares about on hold, and one makes plans that will never come to pass.

All in a day's (half-year's?) work of an unemployed poor soul.

But not all is bad.

This period was also a busy time doing some plans about life, mid- and long-term; the usual ─and some really unusual!─ family events; visits to and from friends, old and new; attending nice little local Debian gatherings or the bigger gathering of Debian SunCamp2016, and other work for side projects or for other events that will happen soon...

And amidst all that, I managed to get some work done on aptitude.

Two pictures worth (less than) a thousand bugs

To be precise, worth 709 bugs ─ 488 bugs in the first graph, plus 221 in the second.

In 2015-11-15 (link to the post Work on aptitude):

In 2016-06-18:

Numbers

The BTS numbers for aptitude right now are:

  • 221 (259 if counting all merged bugs independently)
  • 1 Release Critical (but it is an artificial bug to keep it from migrating to testing)
  • 43 (55 unmerged) with severity Important or Normal
  • 160 (182 unmerged) with severity Minor or Wishlist
  • 17 (21 unmerged) marked as Forwarded or Pending
Highlights

Beyond graphs and stats, I am specially happy about two achievements in the last year:

  1. To have aptitude working today, first and foremost

    Apart from the abandon that suffered in previous years, I mean specifically the critical step of getting it through the troubles of the last summer, with the GCC-5/C++11 transition in parallel with a transition of the Boost library (explained in more detail in Work on aptitude).

    Without that, possibly aptitude would not have survived until today.

  2. Improvements to the suggestions of the resolver

    In the version 0.8, there were a lot of changes related with improving the order of the suggestions from the resolver, when it finds conflicts or other problems with the planned actions.

    Historically, but specially in the last few years, there have been many complaints about the nonsensical or dangerous suggestions from the resolver. The first solution offered by the resolver was very often regarded as highly undesirable (for example, removal of many packages), and preferable solutions like upgrades of one or only a handful of packages being offered only after many removals; and “keeps” only offered as last resort.

Perhaps these changes don't get a lot of attention, given that in the first case it's just to keep working (with few people realising that it could have collapsed on the spot, if left unattended), and the second can probably go unnoticed because “it just works” or “it started to work more smoothly” doesn't get as much immediate attention as “it suddenly broke!”.

Still, I wanted to mention them, because I am quite proud of those.

Thanks

Even if I put a lot of work on aptitude in the last year, the results of the graph and numbers have not been solely achieved by me.

Special thanks go to Axel Beckert (abe / XTaran) and the apt team, David Kalnischkies and Julian Andres Klode ─ who, despite the claim in that page, does not mostly work python-apt anymore... but also in the main tools.

They help with fixing some of the issues directly, or changing things in apt that benefit aptitude, testing changes, triaging bugs or commenting on them, patiently explaining to me why something in libapt doesn't do what I think it does, and good company in general.

Not the least, for holding impromptu BTS group therapy / support meetings, for those cases when prolonged exposure to BTS activity starts to induce very bad feelings.

Thanks also to people who sent their translation updates, notified about corrections, sent or tested patches, submitted bugs, or tried to help in other ways. Change logs for details.

Notes

[1] ^ It's even an example in the Cambridge Dictionaries Online website, for the entry of roller coaster:

He was on an emotional roller coaster for a while when he lost his job.

Catégories: Elsewhere

Kevin Avignon: GSOC 2015 : From NRefactory 6 to RefactoringEssentials

Planet Debian - sam, 18/06/2016 - 18:20
Hey guys, In spirit of my withdraw from the Google Summer of Code program this summer, I thought I’d do a piece of the project I successfully completed last summer. So what brought me to the program last year ? I spent a few weeks on working on a new thing in .NET called Roslyn. … Continue reading GSOC 2015 : From NRefactory 6 to RefactoringEssentials →
Catégories: Elsewhere

Sune Vuorela: R is for Randa

Planet Debian - sam, 18/06/2016 - 11:23

This week I have been gathered with 38 KDE people in Randa, Switzerland. Randa is a place in a valley in the middle of the Alps close to various peaks like Matterhorn. It has been a week of intense hacking, bugfixing, brainstorming and a bit of enjoying the nature.

R is for Reproducible builds

I spent the first couple of days trying to get the Qt Documentation generation tool to reproducible generate documentation. Some of the fixes were of the usual ‘put data in an randomized datastructure, then iterate over it and create output’, where the fix is similar well known: Sort the datastructure first. Others were a bit more severe bugs that lead to the documentation to shuffle around the ‘obsolete’ bit, and the inheritance chains. Most of these fixes have been reviewed and submitted to the Qt 5.6 branch, one is still pending review, but that hopefully gets fixed soon. Then most of Qt (except things containing copies of (parts) of webkit and derivatives) should be reproducible.

R is for Roaming around in the mountains

Sleeping, hacking and dining in the same building sometimes leads to a enormous desire for fresh air. Luckily in the middle of the alps, it is readily available, and at least once a day many people went for a walk. To say hi to a sheep. Or to just go uphill until tired and then going back down. Or just finding a circle around. For this area, OpenStreetMap seems to have better maps than Google. We also went on a nice group trip to Zermatt and surroundings, sponsored by our friends in Edeltech.

R is for Releasing

One of the tasks I set myself for was to get my barcode generation library (prison. you know. being behind bars.) ready for release. A bit of api cleanup, including some future proofing, was done, and all users adapted. Hopefully it will be released as part of the next KDE Frameworks release.

R is for Reviewing code

When signing up for the sprint, one has to declare a couple of tasks to work on. One of the things I put myself up to was reviewing David Faure’s code changes. First, he is very productive, and second, he often gets into creating patches in code areas where many other contributors are scared to look. So someone has to do it, and code never scared me.

R is for Running

I planned on going running along the river monday, wednesday and friday. Fortunately that happened, but due to Switzerland having a bit more ups and downs than flat Denmark, it didn’t go that fast.

R is for Random bugfixing

When in the hacking mood surrounded by great developers, it is very easy to just fix minor bugs when you encounter them. There is likely someone around who knows the code in question. Or you are just in the mood to actually fix it, rather than living with a missing clock applet or a corner case crash.

R is for Rubber ducking

I am a brilliant person sized rubber duck. And I did get the opportunity to show off my skills a couple of times, as well as using some of the other people for that.

R is for Raising money

These sprints in Randa is only possible because of all the nice donations from people and companies around the world. The fundraiser is still running, and can be found at


Help us keep going, at this and many other sprints, clickety-click! :D
Catégories: Elsewhere

Freelock : A Flash of Insight

Planet Drupal - sam, 18/06/2016 - 02:45

Its name is Watney. Watney lives in Matrix. Watney is a bot I created about 6 months ago to start helping us with various tasks that are instrumental for day-to-day tasks we need to do in our business.

Watney patiently waits for requests in a bunch of chat rooms we use for internal communications about each website we manage, each project we work on. Watney does a bunch of helpful things already, even though it is still really basic -- it fetches login links for us, helps us assemble release notes for each release we do to a production site, reminds us when it's time to do a release, and kicks off various automation jobs.

DevOpsConcourseMatrixBotWatneyDrupalDrupal Planet
Catégories: Elsewhere

Acquia Developer Center Blog: Drupal 8 for beginners - meet Brandon Relph

Planet Drupal - ven, 17/06/2016 - 19:01

I met 15-year-old serial entrepreneur--CEO of goCreative--and budding Drupalist Brandon Relph at the inaugural ThinkNation event in Canterbury, in December 2015. In this podcast, we talk about how he got to know Drupal 8 and what he thought of it. And I was surprised to learn that there is a world of professional Minecraft out there, in which Brandon runs two professional ventures and employs a couple dozen people around the world.

Brandon met Drupal when he began building the ThinkNation website in Drupal 8 as part of a work-experience week with the UK Agency Miggle. From an interview with Brandon on the ThinkNation website, Putting young people at the heart of ThinkNation: “Working on the ThinkNation site seemed a daunting process at first. I had just arrived to the Miggle office for my work experience and was given the task of converting the pre-made designs of ThinkNation into HTML/CSS that afternoon!” Miggle founder, Alick Mighall talks about Brandon and ThinkNation in this post: Young Thinking.

Interview video - 10 min.

Guest dossier
  • Name: Brandon Relph
  • Work affiliation:
    • CEO goCreative - “We create awesome Minecraft creations”
    • Block Arts - “The new way to share all things Minecraft”
  • Twitter: @brandonrelph
  • 1st version of Drupal: Drupal 8!

jam: Right. We – this guy and I have just spent the whole day at this thing called ThinkNation and ThinkNation – what did you think of the day?

Brandon Relph: It was very well put together. It was very interesting and engaging.

jam: If you had to describe it to someone else who wasn’t here, how would you describe this event?

Brandon Relph: Something to almost answer those big questions that you may have.

jam: Right. So the format was roughly five big questions involving human life at the deepest level. Should we invest in technology to extend it, should we invest in space flights, questions about mortality, really kind of serious stuff. And it was put together ... So there were a series of experts, speakers and artists and a poet and some dancers and everybody addressing these questions in different ways. I found it incredibly rich and I was pretty excited and the plan is to have more of these. Would you come back?

Brandon Relph: For sure.

jam: So please introduce yourself.

Brandon Relph: My name is Brandon Relph. I’m from Bishop Bell School in Eastbourne. I did my work experience with the company Miggle, which helped design the website for this event.

jam: That’s our secret Drupal connection of the day. So what did you do on your work experience?

Brandon Relph: I was the first person to start the ThinkNation site.

jam: Which was built in...?

Brandon Relph: Drupal 8.

jam: Oh, lovely!

Brandon Relph: This was back in June time. So it was when - before it had even been released. Yes, I built lots of the front end and I also got to use Drupal 8, which I’ve never used before.

jam: So what’s your development, IT, web sort of background?

Brandon Relph: In school, I study computer science. Outside the school, I do lots of computer-related activities. I also own my own company, which ... we do stuff on the computer and everyday internet.

jam: So you’re an entrepreneur.

Brandon Relph: Yes, you could call me that.

jam: In geek terms, Alick Mighall said, “Go make a Drupal 8 site,” and just set you loose, right? How was it to open up Drupal for the first time and...?

Brandon Relph: It was a challenge. I have to say it’s very easy to install it and when we were doing – on the first day, I basically got told, “Oh yes, we use Drupal.” I got talked through what it was. I got left a bit to decide and get to know it and they were like, “Oh, here’s the site. We want you to start.” So I started. I think pretty much in the first afternoon.

jam: Conceptually, was it an easy thing to get into, given your background?

Brandon Relph: It was very different because I’m used to coding raw PHP and it actually probably was a lot easier than what I do. So I suppose in a way, I was doing lots of the front end to begin with but we explored the back end of Drupal afterwards and getting to know how it will work opened my eyes up to how I kind of over-complicate stuff.

jam: Wow! That’s really interesting. So in Drupal, we talked a lot about how we empower people to use this very complex technology stack by making a great user interface and a great experience. Did it feel that way? Can you identify with that?

Brandon Relph: Yes, it felt like the process was a lot quicker than it would necessarily been if I would have had to hard code it.

jam: Now, most people that I interview – I’ll ask them something like, “What’s your first Drupal memory?” but your first Drupal memory is only June and it sounds like it was entirely positive.

Brandon Relph: Yes.

jam: Is Drupal something that you are going to try out for your own projects and get back to at some point?

Brandon Relph: I probably will. It’s busy time at the moment with school and everything to running your own company but it’s definitely something that I want to look into in the future as it seems like a really good alternative to hard coding stuff.

jam: So now, I’m just going to stand in front of you so that we can get the height comparison. How old are you?

Brandon Relph: I’m 15.

jam: You are 15. Thank you very much. So entrepreneurialism is a big theme at this event today. A guy called Ben Towers just had a bit of a speech. He’s 17 and he’s a serial entrepreneur as well and quite well known here in Britain. Do you think he’s sort of a role model?

Brandon Relph: Yes, I suppose he’s one of those where maybe I could be even – he could be my target for the next two years because as I progress and I move on, I’d hope that one day I will be standing up at events like this. I think around now is kind of the starting point of that with a television interview coming up in the next couple of weeks and it’s going to be taking it from there.

jam: So how did you discover programming was for you and how did you become an entrepreneur?

Brandon Relph: I discovered programming was for me when I sat down and I realized that I had a problem and that I needed to find the solution and programming was that type of thing. So I learned my first programming language when I was 12 or 11 – 12 and that was pretty much basic HTML/CSS and then I got into more of the backend and I did some Java and a bit of C. I suppose I became an entrepreneur when I found something that I enjoyed and I have a friend of mine in Germany who is my business partner, so to speak and we now – over the past two years, have kind of built up the company and we now have – there’s 25 of us and we all live all around the world.

jam: Wow! So getting into tech was a scratch-your-own-itch story. You had a problem that you needed to solve and you went and figured it out.

Brandon Relph: Yes. Then, I noticed that other people also have problems and why can't I capitalize on that?

jam: Hey! Presto! You have a business.

Brandon Relph: Yes.

jam: So what are the 25 of you doing now?

Brandon Relph: Some of you may know the game Minecraft. If not, you can Google it. We use it as like an ...

jam: For that one person who hasn’t heard of Minecraft.

Brandon Relph: Yes. We use it like a tool, a marketing tool that companies – and they employ us to make software and also stuff in the actual game in order to sell their product or sell their movie or like that. We also use Minecraft in education and we have recently taken on a chemistry project with a school where we make Minecraft – we made atoms in Minecraft and then we show children how they work and how they interact with each other. So I suppose it’s kind of that that drives me forward with everything.

jam: Minecraft seems to me to be another sort of perfect system where they’ve made something so abstract and yet so easy to use that you can sort of turn it into anything.

Brandon Relph: Yes, it’s one of those. People describe it as Lego and especially when you’re building. It’s so much like Lego but in the computer. So it’s like Lego on steroids type of thing and it can be used for pretty much anything and the beauty of the game is once you play it, it’s so simple to understand and it’s engaged with so many children and not just children but generations. Yes, it’s just great.

jam: You do have a passion for it. I mean otherwise, you wouldn’t be in business at this point either.

Brandon Relph: There’s still a market for it even five years after its development. There’s still a big market for it and it’s still on the rise.

jam: Are you working on the next big idea?

Brandon Relph: Oh, maybe.

jam: Oh, cagey! Cagey! Very good. So let’s sum up. ThinkNation, yes – no?

Brandon Relph: Yes.

jam: You’re going to be back?

Brandon Relph: Definitely!

jam: Are you going to submit a talk maybe?

Brandon Relph: Oh, I might be submitting – maybe.

jam: Okay. Alright! Drupal, yes-no?

Brandon Relph: Yes, in the future.

jam: Are you going to come back to it?

Brandon Relph: After my studies, yes.

jam: Alright! Cool! Anytime you want, you call any of us. There are several hundred thousand of us who can help you out with that. We’d love to. Start with Alick and then – you know. Awesome! And Minecraft, yes or no?

Brandon Relph: Yes, but not forever. It’s going to die one day but for now, it’s a great tool and I plan on using it for the future.

jam: So Brandon, give us your shameless pitch.

Brandon Relph: So if you’re looking to further your brand, you can contact us. We’re called goCreative. We’re an international company of 25 and that’s in 13 different countries and seven different time zones. You can find us online at go-creative.co and you can also find us on Twitter @goCreativeMC.

jam: It’s so nice to meet you.

Brandon Relph: Nice to meet you too.

jam: Thanks for taking the time to talk.

Brandon Relph: Thanks for having me.

Podcast series: Drupal 8Skill Level: BeginnerIntermediateAdvanced
Catégories: Elsewhere

Acquia Developer Center Blog: Review GitHub Pull Requests with Ease

Planet Drupal - ven, 17/06/2016 - 16:35

If you are like me and have to spend a lot of time reviewing large patches on GitHub you know it is a daunting task.

There is no easy way to navigate through multiple diffs so you have to scroll a lot (and I mean a LOT) and watch very carefully to not to miss what you are looking for.

It is tiring and frustrating.

Tags: acquia drupal planet
Catégories: Elsewhere

DrupalEasy: DrupalEasy Podcast 179 - Need to Pee (Michael Schmid, amazee.io, Drupal Community Keynote)

Planet Drupal - ven, 17/06/2016 - 15:58

Direct .mp3 file download.

Michael Schmid (Schnitzel), Group CTO of Amazee Group, CTO of amazee.io and super-active Drupal community contributor joins Kelley, Anna, and Mike to discuss amazee.io and Michael's recent DrupalCon New Orleans Community Keynote. This episode also touches on the new (also Swiss!) king of the hill in Drupal code contributions as well as the recent changes at the Drupal Association.

Interview DrupalEasy News Three (Two) Stories Sponsors Picks of the Week
  • Mike - Rules module again, because it is so freakin' awesome.
  • Anna - Teleport.org uses “Big Data” to compare different places to live. Focused on start-ups and other knowledge workers. Fun to look at (and scope out places where I might need to move after November!).
  • Kelley - Headspace mindfulness app to reduce stress, improve focus, relax.
  • Michael - Drop Guard - Updates your Core and Modules automatically.
Upcoming Events Follow us on Twitter Five Questions (answers only)
  1. Drones! FPV and Video/Photo Drones.
  2. Alexa and Wink (Home Automation).
  3. Life.
  4. An Elephant.
  5. At DrupalCon Copenhagen's closing ceremony - the Kitten Killers performance.
Intro Music Subscribe

Subscribe to our podcast on iTunes, Google Play or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

Catégories: Elsewhere

Drop Guard: The risk of ignoring Drupal updates

Planet Drupal - ven, 17/06/2016 - 12:30

There is no question about the importance of regularly updating your Drupal installation, including core, contribs, and libraries.

No matter how you manage the workflow - by using dedicated tools, custom scripts, or just update the codebase via FTP - keeping the application's 3rd party code always up-to-date is a must for every open source project.

Without getting into the details of why this is important (in fact we believe our readers don't need to be convinced at all), we decided to imagine the consequences of intentionally ignoring all updates in your project or updating the codebase selectively, when some modules get their new versions regularly and the rest remains outdated.

workflow Drupal Planet Security
Catégories: Elsewhere

PreviousNext: Native PHPStorm Drupal Test Runner

Planet Drupal - ven, 17/06/2016 - 05:08

PHPStorm has a lot of built in test runners, but it doesn't support Drupal's Simpletest test runner. In this blog post we'll see how we can execute Drupal tests inside PHPStorm using Drupal test runner.

Catégories: Elsewhere

Chromatic: Backup Your Drupal 8 Database to S3 with Drush & Jenkins

Planet Drupal - ven, 17/06/2016 - 01:06

There are many different ways to handle offsite database backups for your Drupal sites. From host provider automations to contrib modules like Backup and Migrate and everywhere in between. This week, I was looking to automate this process on a Drupal 8 site. Since Backup and Migrate is being rewritten from the ground up for Drupal 8, I decided to whip up a custom shell script using Drush.

I knew I wanted my backups to not only be automated, but to be uploaded somewhere offsite. Since we already had access to an S3 account, I decided to use that as my offsite location. After doing a bit of Googling, I discovered s3cmd, a rather nifty command line tool for interacting with Amazon S3. From their README.md:

S3cmd (s3cmd) is a free command line tool and client for uploading, retrieving and managing data in Amazon S3 and other cloud storage service providers that use the S3 protocol, such as Google Cloud Storage or DreamHost DreamObjects. It is best suited for power users who are familiar with command line programs. It is also ideal for batch scripts and automated backup to S3, triggered from cron, etc.

It works like a charm and basically does all of the heavy lifting needed to interact with S3 files. After installing and setting it up on my Drupal 8 project's server, I was able to easily upload a file like so: s3cmd put someDatabase.sql.gz s3://myBucket/someDatabase.sql.gz.

With that bit sorted, it was really just a matter of tying it together with Drush's sql-dump command. Here's the script I ended up with:

# Switch to the docroot. cd /var/www/yourProject/docroot/ # Backup the database. drush sql-dump --gzip --result-file=/home/yourJenkinsUser/db-backups/yourProject-`date +%F-%T`.sql.gz # Switch to the backups directory. cd /home/yourJenkinsUser/db-backups/ # Store the recently created db's filename as a variable. database=$(ls -t | head -n1) # Upload to Amazon S3, using s3cmd (https://github.com/s3tools/s3cmd). s3cmd put $database s3://yourBucketName/$database # Delete databases older than 10 days. find /home/yourJenkinsUser/db-backups/ -mtime +10 -type f -delete

With the script working, I created a simple Jenkins job to run it nightly, (with Slack notifications of course) and voilà: automated offsite database backups with Jenkins and Drush!

Catégories: Elsewhere

Pages

Subscribe to jfhovinne agrégateur - Elsewhere