I build and destroy a lot of VMs using Vagrant in the course of the day. Between developing Drupal VM, writing Ansible for DevOps, and testing dozens of Ansible Galaxy roles, I probably run vagrant up and vagrant destroy -f at least a dozen times a day.
Building all these VMs would be a pain, and require much more user intervention, if it weren't for a few things I've done on my local workstation to help with the process. I thought I'd share these tips so you can enjoy a much more streamlined Vagrant workflow as well!
While I blog about my various contributions at work, I thought it might be useful to mention what my current priorities are. My current plan looks like the following:Tags:
When comparing the most commonly-used content management frameworks, web developers typically cite Drupal's robust support for taxonomies as one of its leading strengths. This should come as no surprise to anyone with even minimal experience in using taxonomy vocabularies and their terms in designing and building new websites, largely because they provide a proven way to categorize and make findable the content of any website, with relatively little effort.
Specifically, every piece of content can be tagged with zero or more terms defined within an unlimited number of vocabularies, and these tags can be used in myriad ways for grouping and sorting that content. In the case of a taxonomy term reference used by a view of one or more content types, the sort order and filtering can be specified by the developer using the Views interface or within a custom module, or that functionality can be exposed to the end-user.
The judicious use of taxonomies can be a powerful component of any content strategy that is intended to grow and change. This is true not just for on-page site visitors, but also for people consuming that content in RSS aggregators for whom only some of the content is of interest.
In this examination of some best practices, techniques, and useful contrib modules associated with taxonomies, it is assumed that the reader has a basic understanding of vocabularies and termsSelect Field Versus Taxonomy
When adding to a content type a new field that will contain a value from a predefined list of possibilities, you have the option of utilizing a field of type "List (text)" (or one of the two numeric variants of "List"), and setting the Allowed values list on the field settings page. Or you can employ a taxonomy term reference, which, as the name implies, refers to a term in the taxonomy vocabulary specified when creating the field. Here are some sensible guidelines:
If you want the client to be able to add, change, or remove the allowed values of the field in question, then taxonomy is definitely the right choice. Even if you will likely never alter the list, then a select list should work fine as the field type.
https://fedrtc.org has been running for a while now and this has given many people a chance to get a taste of regular SIP and WebRTC-based SIP. As suggested in Zoltan's blog, it has convenient integration with Fedora SSO and as the source code is available, people are welcome to see how it was built and use it for other projects.Issues with Chrome/Chromium on Linux
If you tried any of FedRTC.org, rtc.debian.org or meet.jit.si using Chrome/Chromium on Linux, you may have found that the call appears to be connected but there is no media. This is a bug and the Chromium developers are on to it. You can work around this by trying an older version of Chromium (it still works with v37 from Debian wheezy) or Firefox/Iceweasel.WebRTC is not everything
WebRTC offers many great possibilities for people to quickly build and deploy RTC services to a large user base, especially when using components like JSCommunicator or the DruCall WebRTC plugin for Drupal.
Native applications and mobile apps like Lumicall continue to offer the most optimized solution for each platform although WebRTC currently offers the most convenient way for people to place a Call me link on their web site or portal.Deploy it yourself
The RTC Quick Start Guide offers step-by-step instructions and a thorough discussion of the architecture for people to start deploying RTC and WebRTC on their own servers using standard packages on many of the most popular Linux distributions, including Debian, Ubuntu, RHEL, CentOS and Fedora.
With only 5 critical issues marked as "needs work", Drupal 8 - the most brilliantly amazing responsive accessible version of Drupal to be released so far - is just around the corner (we're so excited, we forgot to put commas in that list of adjectives). Last week Acquia announced they now have Drupal 8 available on their platform for clients to start building their D8 sites on.
In recent months I've been demoing visual monitoring to many developers. The reaction was always positive, but I've realized that not enough people have taken the step from recognizing the need to actually implementing it on their own projects.
If you have been following my recent blog posts or tweets you've probably noticed we are trying to bring visual monitoring along with Shoov to the masses. To do so we're trying to reduce the complexity and codify our "lessons learned".Drupal.org visually monitored by Shoov
Yeoman generators is one way to achieve this. With the new yo shoov - a single command makes sure all the files needed for visual monitoring are immediately scaffolded in your repository. In fact, it also sets up Behat tests along with a .shoov.yml that will allow Shoov to run your visual monitoring tests periodically.
Since visual monitoring might be new for a lot of people, the generator not only scaffolds the files but also attempts to check if your system is properly installed, and tells you how to fix it if not.Shoov generator in action.
Drupal.org frontpage posts for the Drupal planet: Secure your account: Two Factor authentication on Drupal.org
Drupal.org users* can now use Two factor authentication to increase the security of their accounts. It can be enabled via Security tab of your user profile page. Read the detailed instructions at Enabling TFA on Drupal.org.
This was made available to Drupal.org admins in May. It is now required for users who have advanced access on Drupal.org. However, every user can benefit from the security that two factor authentication offers.
If you want to make two factor authentication available on your own Drupal site, you can install the TFA module.
* Two factor authentication is available for all users with the 'confirmed user' role. If you don't see 'Security' tab on your profile page, you might be missing the role. Just keep posting content on Drupal.org and it will be granted soon. You can also apply to get the role.Front page news: Planet Drupal
This post is part 2 in a series of Docker posts hashing out a new docker workflow for our team. To gain background of what I want to accomplish with docker, checkout my previous post hashing out a docker workflow.
Developers are known for their most famous topics to be testing and doumentation - not. And I'm no different. However, the bigger my projects tend to get and the longer they last, the more this becomes a real issue so that even the developer in me starts to promote the idea of proper testing and documentation. And to cut a long story short: BDD (behaviour driven development) can deliver a significant part in both of these areas.
I made a small module which is just meant to store user preferences. There's the normal-ish approach of using a field on either the User entity or the Profile entity but in all honesty this can get messy when you add one ...then another one. Oh god the client wants more user options. Soo you get it.
Drupal 6 veterans, remember the fun times of $user->data, the mad grab wild west of "here's an array, do what you will" which also exists in D7.
User preferences was created to solve this problem, taking a proper approach at storing user preferences which don't require you to regret slapping another field on an entity or crying in the shower scrubbing yourself after using $user->data.
There's work to do around the schema and looking at how to best store different types of values in the Database (currently just string), but this module is a first good step. Some tests need writing too, patches welcome!
Anyway, that's it for now. Stable release coming soon after some testing.
Drupal @ Penn State: One liner to install php 7, mysql 5.6, apache 2.4, drush and drupal on centos 7
It was a nice little saturday in happy valley. Since my son is forcing us to watch the Sponge Bob Square Pants movie over and over, I decided to multi-task. Bryan Ollendyke has been talking about PHP 7 a tad bit lately so I decided to whip up an instance.
Granted this is not ready for prime-time just yet, however, it is extremely fast and everything that I have tested so far works fine. Turn on authcache and it is REALLY fast!
Today I am going to show you how to autopilot monitoring and diagnose of
- Slow queries
- Long query wait times due to database locks
- Database deadlocks
All of theseMore articles...
- How to use NetPhp
- When PHP crashes: how to collect meaningful information and what to do with it
- Only update changed fields or properties for an entity in Drupal
- Installing Drupal on Windows and SQL Server
- Distinct options in a views exposed filter: The Views Selective Filters Module
- Using LINQ (Language Integrated Queries) in Drupal or how to write queries x5 faster
- Deploying changing module dependencies with Drupal
- Getting #2,000 requests per second without varnish
- Benchmarking Drupal 8 on PHP 7-dev
- Drupal Session Handler: everything you need to know
In this tutorial (for NYC CAMP 2015) we'll explore how to use Drupal 7 and DrupalGap 2 (powered by Angular JS) to build a decoupled ("headless") web application for Drupal. In a nutshell, here is what the app will do:
- A user runs the app in their browser
- The browser asks the user for access to their current location
- The app passes their location to Drupal
- Drupal will return nearby content (if any) to the app
- The app will display the locations on a map and let the user click on them to see more details
Ready? Let's rock and roll, no time to fiddle...
Like Chinese philosophy Yin and Yang, Coding and testing support each other. Here I want to introduce a method to increase the rate of software project success. It is a critical thinking in programming, an agile methodology on a micro-scale level. What is it? In every line of code, every loop or conditional block, we look for multiple solutions. For each solution, we evaluate possibilities of going wrong. Pick the most reliable one. It helps us remove most of code vulnerability at beginning.
Knowing how to test is more important than knowing how to coding. A good function is stable, fast and, requires less memory and computing resources. It is not necessary to be complicated or has difficult API functions under the hood. Usually, it has less code and seems to be simpler than the rest. And it is the result of various tests and trying different methods. We choose the best way to compose the code base on various tests. It ensures robust software system with less vulnerability.
Let us say there is a project that send human beings to the Mars. If we are part of the project and our responsibility is to land the spaceship on the surface of the planet safely. How to make sure 'Landing Function' work without any deadly 'bug'? To us, what is the most important thing for it? It is not the landing gear; it is not the parachute. It is the tests. Under different situations, we performing hundreds or thousands of tests to validate each equipment. Find those thousands testing cases is the most difficult and important task. We need to find as close condition as possible under which when landing the spaceship on the Mars. The temperature, the speed of the spaceship, the chemical in the air, etc. Test materials under all sorts of combined circumstances. Any possibility that can go wrong, we will let it fail in the test.
When we solve a problem or fix bugs, we do the same thing. We do some research. By doing some research, we guess the cause of a problem. Then, we try to prove it with many tests. If the test results are positive, then, we came to a conclusion. Otherwise, we continue guesses and tests. Insufficient tests may lead us to a wrong conclusion.
Again, the tricky thing is how we test it. It is same when building new functions or modules. Whenever there is a solution, we put it under different conditions and validate it. We cover it with enough test cases. Like Chinese philosophy Yin and Yang, Coding and validating support each other.
When building a complex function, we may divide it into many baby steps. Each step is important to the overall success. Exhaust the ways testing each step to make sure each one is good. The result of the previous step can safely serve the next step. Finding a good way to test each step is crucial. Because there are many ways to do a thing. We need to choose the best one with tests. To each baby step, there can be a dozen ways to take. Able to find the most reliable way is a merit of a good software developer or a project leader. When pushes code to production, it can be way more complicated and possible to break. As laws of Murphy, anything that can go wrong will go wrong. So, have multiple test scenarios prepared for the smallest function unit. It is essential to make our code safe and sound. We will never overestimate the importance of it.
When it comes to a complex function, dividing it into small functional units that are easy to verify. Let's say the CYouTube project. We divide it into multiple steps and sub-steps. Each step has an easy and clear goal to achieve.
Each of those major Steps has multiple sub-steps. For example, pulling data from YouTube has following sub-steps.
Each of the sub-task or major task is easy to verify. Whenever, something goes wrong, we can follow the steps and find the broken one. From large scale to small, we can use this methodology. When we practise it more, our minds become more capable to find those steps with clear goals; We will foresee the problem when we choose the way to implement each step. That is before we do some real coding; That is how we can develop software that requires less maintenance.
Test-driven development (TDD) relies on the repetition of a very short development cycle. The developer writes an automated test case before writing code. Our approach is a step ahead of it. When thinking about the solution, we find test cases first. Passing those test is the goal of next step - coding. We start think about test case when we read the requirement document. When we write code, we are thinking about how to break it. Whenever we finish a function, it went though many verification tests by ourselves. When it finishes, we have a much better chance to have a fully functioning module. If it does not work out, we can always return to each step and find the broken link by reiterating the verification process. I believe it is the most efficient way to develop something.
Why not combine the two and let Drupal provide Meteor with semantic data with Meteor rendering that data in a reactive way?Drupal How-Tos
Human Rights Watch (HRW) has been sharing important stories for over 30 years and we were excited about enhancing the digital story-telling experience in the latest relaunch of HRW.org. Out-of-the-box, Drupal provided a great platform for us to craft tools that matched HRW’s internal publishing workflows, while allowing their publishers to create long-form content with videos, galleries and other rich content.Embedded Media
Aten's design team set the bar with the new design direction for HRW.org. Their vision for the long-form articles included flexibility for embedding media content throughout the text. After a lengthy evaluation period with Drupal’s Media module, it become clear that HRW needed more flexibility than it provided. In addition to embedding file based media (i.e. images), there were requirements around embedded text based content like quotes and callouts for other node based content. For consistency, we went with the Node Embed approach that we’ve blogged about before. Having a node-based workflow also provided a familiar workflow for HRW’s publishers.Long-form Reports
One of HRW’s most important tasks is creating in-depth reports on certain issues around the world. It's not uncommon for these reports to approach 100 pages In PDF form. Two goals of the relaunch included the report creation workflow in Drupal and improving report navigation.Report Creation Workflow
HRW has an internal workflow for editing and publishing reports that they’ve used for years. The end product of that workflow is a printed report and an online HTML version. Rather than trying to force a new internal workflow, we discussed pain points HRW had with their current process and built a couple tools to provide a better experience.HTML Upload
When creating report nodes in Drupal, HRW can upload the HTML file that was created outside of the content management system. The upload process adds anchor tags and generates a table of contents based on semantic heading tags, detects image references that do not exist on the site yet, and makes a few other formatting changes The report content and table of contents are then saved in the database rather than processing the uploaded content on the fly.Report Navigation
In past iterations, reports were broken up into many pages. Now, users can use the table of contents to quickly jump to relevant sections of the report. Having reports on a single page also allows users to use built in browser tools like “Find” to search for keywords.Featured Content
HRW has many topic and location based landing pages where editors can curate content. HRW wanted the flexibility to manually feature content or, given the large number of these pages, have the most relevant automatically show up. To achieve this, we used Views, Entity Reference, and a custom module to tie the two together. The custom code checks the Entity Reference field for manually curated content then utilizes Views to pull the relevant content into the remaining content slots available. This allows HRW to mix curated and automated content easily without having to choose one approach over the other.Related Content
Rather than showing users additional content at the bottom of an article based on time or tag, we worked with HRW to craft an algorithm, or scoring system, to display related content. When deciding which relevant content to show, date, geography, and topic are all taken into consideration. Similar to featured content, HRW has the flexibility to manually relate content on any article with the algorithmic suggestions filling missing slots.Sharelines
Once HRW publishes important information, they leverage social channels like Twitter to help spread the word. We provided HRW publishers the ability create curated Sharelines that are displayed prominently for users to Tweet directly from the article.
It was exciting to work on such a large publishing project and help provide tools to help tell important stories in many languages. We hope you enjoy browsing the new HRW.org!
Drupal is a pretty strong content manager, allowing you to build robust data models, easily enable content revisioning, and build a publishing workflow complex enough for even the strictest of editorial standards. However, the blistering speed of development on Drupal 8 appears glacial when compared with the rate of invention on the frontend of web development.Drupal
If you have a large Drupal site, you may have a large number of roles and users.
To thoroughly test your site and make sure everything is working correctly, it's smart to browse your site under different roles.
Yes, you can create fake accounts for each user role, but that becomes very cumbersome if you have more than a couple of roles.
The Masquerade module is very easy to use, and it allows yourself to see the site through the eyes of any user you choose:
At a recent Acquia all-company meeting, I was glad to hear that half of the current group of Acquia U students and 7 out of 12 of the latest "BDR" hires in Sales were women. Acquia's CEO, Tom Erickson added that this was the result of some "objective, data-driven" hiring practices. I had to know more. I got Acquia Senior Manager of Business Development and Sales, Chris Hemberger on the line to talk about all of this.
This was our 8th critical issues discussion meeting to be publicly recorded in a row. (See all prior recordings). Here is the recording of the meeting video and chat from today in the hope that it helps more than just those who were on the meeting:
If you also have significant time to work on critical issues in Drupal 8 and we did not include you, let me know as soon as possible.
The meeting log is as follows (all times are CEST real time at the meeting):
[11:11am] jibran: https://www.drupal.org/node/2525910
[11:11am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 22 IRC mentions
[11:12am] alexpott: https://www.drupal.org/node/2525910, https://www.drupal.org/node/2493911 is the issue dawehner is talking about
[11:12am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 23 IRC mentions
[11:12am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 6 IRC mentions
[11:13am] dawehner: GaborHojtsy++
[11:13am] dawehner: GaborHojtsy++
[11:13am] alexpott: https://www.drupal.org/node/2524082 is the config overrides https://www.drupal.org/node/2524082
[11:13am] Druplicon: https://www.drupal.org/node/2524082 => Config overrides should provide cacheability metadata [#2524082] => 110 comments, 32 IRC mentions
[11:13am] Druplicon: https://www.drupal.org/node/2524082 => Config overrides should provide cacheability metadata [#2524082] => 110 comments, 33 IRC mentions
[11:14am] GaborHojtsy: https://www.drupal.org/node/2338081
[11:14am] Druplicon: https://www.drupal.org/node/2338081 => Local Tasks, Actions, and Contextual links should use a TranslationWrapper to encapsulate safe translatable strings from YAML files [#2338081] => 62 comments, 16 IRC mentions
[11:14am] jibran: https://www.drupal.org/node/2493911
[11:14am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 7 IRC mentions
[11:15am] WimLeers: https://www.drupal.org/node/2525910
[11:15am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 24 IRC mentions
[11:15am] WimLeers: https://www.drupal.org/node/2532490
[11:15am] Druplicon: https://www.drupal.org/node/2532490 => Unrouted URLs break toolbar but are hidden by caching [#2532490] => 31 comments, 8 IRC mentions
[11:17am] WimLeers: https://www.drupal.org/node/507488?page=1#comment-10127746
[11:17am] Druplicon: https://www.drupal.org/node/507488 => Convert page elements (local tasks, actions) into blocks [#507488] => 280 comments, 57 IRC mentions
[11:22am] WimLeers: plach's issue: https://www.drupal.org/node/2351015
[11:22am] Druplicon: https://www.drupal.org/node/2351015 => URL generation does not bubble cache contexts [#2351015] => 300 comments, 57 IRC mentions
[11:23am] Fabianx-screen: https://drupalreleasedate.com/ shows 997 majors and 376 added in the last year.
[11:24am] jibran: https://www.drupal.org/node/2504141
[11:24am] Druplicon: https://www.drupal.org/node/2504141 => Information disclosure/open redirect vulnerability via blocks that contain a form [#2504141] => 66 comments, 12 IRC mentions
[11:28am] dawehner: https://github.com/guzzle/guzzle/issues/1166
[11:29am] dawehner: https://www.drupal.org/node/2493911
[11:29am] jibran: https://www.drupal.org/node/2493911#comment-10124104
[11:29am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 8 IRC mentions
[11:29am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 9 IRC mentions
[11:37am] dawehner: https://www.drupal.org/node/2528178
[11:37am] Druplicon: https://www.drupal.org/node/2528178 => Provide an upgrade path for #2354889 (block context manager) [#2528178] => 45 comments, 9 IRC mentions
[11:38am] dawehner: https://www.drupal.org/node/2528178#comment-10123746
[11:38am] Druplicon: https://www.drupal.org/node/2528178 => Provide an upgrade path for #2354889 (block context manager) [#2528178] => 45 comments, 10 IRC mentions
[11:43am] jibran: https://www.drupal.org/node/2464427#comment-10127680
[11:43am] Druplicon: https://www.drupal.org/node/2464427 => Replace CacheablePluginInterface with CacheableDependencyInterface [#2464427] => 94 comments, 9 IRC mentions
[12:14pm] dawehner: https://www.drupal.org/node/2338081
[12:14pm] Druplicon: https://www.drupal.org/node/2338081 => Local Tasks, Actions, and Contextual links should use a TranslationWrapper to encapsulate safe translatable strings from YAML files [#2338081] => 62 comments, 17 IRC mentions