Skip to Content

Drupal

SitePoint PHP Drupal: Exploring the Cache API in Drupal 8

Planet Drupal - 25 February 2015 - 9:00am

Drupal 8 comes with many improvements over its predecessor we have grown to both love and hate. Next to prominent systems such as Views in core, configuration management or a useful translation service, there are also less known changes but that are equally important to know and use. One such improvement has been the cache API that solves many performance problems we have in Drupal 7.

In this article, I want to shine a bit of light over the new cache API. To this end, we are going to look at how we can use it in our custom modules as we are encouraged to do so much more in Drupal 8.

Additionally, I have prepared a little demonstration in the shape of a module you can install for testing the impact of the cache API. It’s a simple page that in its rendering logic makes an external API call (to a dummy JSON endpoint) and caches its results. The page then displays the actual time it takes for this to happen, contrasting the external call time vs. the cached version time.

The new cache API Bins

The new cache API (with the default DatabaseBackend storage) is stored in multiple bins which map to tables that start with the prefix cache_. When interacting with the cache, we always start by requesting a cache bin:

$cache = \Drupal::cache();

Where $cache will be an instance of the DatabaseBackend object that represents the default bin (cache_default). To request a particular bin we pass in the name in the constructor:

$render_cache = \Drupal::cache('render');

Where $render_cache will represent the render cache bin (which is new in Drupal 8 and is supposed to improve render performance across the board).

Continue reading %Exploring the Cache API in Drupal 8%

Categories: Drupal

Amazee Labs: DrupalCon Latin America 2015 - A recap

Planet Drupal - 25 February 2015 - 7:01am
DrupalCon Latin America 2015 - A recap

For the first time, DrupalCon happened in Latin America! Dagmar, Emma and me spent a week in Bogotá to speak about Drupal and to connect with the local communities. 

DrupalCon Latin America

To be honest, after low registration numbers and too many e-mail reminders for buying tickets, my expectations for the first DrupalCon in Latin America were not too high. Together with our project manager Dagmar and front-end expert Emma, we were still excited to go and support the regional communities. After having made many friends during my Drupal tours in Central America it felt like a great opportunity to visit South America for the first time and share experiences with local leaders.

A local looking out over Bogotá, the capital city of Colombia

 

Colombian's selling coffee on the streets of Bogotá

DrupalCon

With 260 attendees, the conference was more like a camp and can't be compared with DrupalCons in the U.S. or Europe, which have several thousands of attendees. Still, this DrupalCon Latin America wasn't just a camp: attendees came from all over Latin America and many even flew in from the United States, Europe or even South Korea. The presentations I was listinig to where of high quality and the live-translation service from and into Spanish, Portuguese and English seemed to be working great and was constantly being used by many attendees.

Attendees gathering in the main conference room

While Dries Buytaert's keynote pointed out some good examples on how the web is evolving, the analogy of using technology to minimize time being spent for getting a valentines present didn't play well for my taste. Larry Garfields held a very motivating keynote and you could feel the audience getting excited for the sprints on Thursday.

DriesnoteLarry Garfield's keynote

Other session highlights include: Drupal 8 CMI on Managed Workflow with a great music / dance intro by Matt Cheney and Molly Byrnes; Drupal in the Post-PHP-Renaissance World by EclipseGc; Designing Drupal 8 by Lewis Nyman; An Overview of the Drupal 8 Plugin System by Joe Shindelar and Persiguiendo el unicornio: Por más mujeres en tecnología by Kandra. As usual you can find the videos on the Association's Youtube Channel and they are linked from the session pages.

A dancy kick-off to the CMI managed workflow session

Dagmar did a presentation on SEO for Drupal. The presentation was packed and a big success. My presentation for DrupalCon was special for me. For the first time #d8rules - Web-automation with Rules in Drupal 8 was code-driven. Given the early stage and complexity of the project, I initially struggled with the preparation. In the end, diving into the Rules 8.x code and putting it into a presentation turned out to be fun and a good example to show some new programming patterns in Drupal 8.

Dagmar presenting Amazee Labs best practices on SEO

The size of the event also allowed to connect even better with the attendees. I feel like I got to shake almost everyones hands and was able to connect much better than on large-scale DrupalCons where it is unlikely to run into the same person twice even during several days of conference.

Attendees wearing ear-plugs for live translation services from and to English, Spanish and Portuguese

I love to travel in the Latin American region because of the friendliness of people and the special vibe of the culture. The local team setup a great set of social activities ranging from cycling through the city, traditional & explosive games to enjoying city views at night and of course latin dances such as Salsa.  "Northern" Drupal events tend to be a bit stiff, we can definitely learn from our Latin friends in this matter!

Watching the city lights as part of a tour organised by the local team

 

The conference venue after the last session

Drupal in Latin America

Latin America is an uprising market that has lots of potential, not directly comparable but similar to India where DrupalCon makes its extra-stop in 2016. It was good to see a variety of local Drupal shops present at the conference that already have years of experience in delivering web solutions based on Drupal that where looking to hire new talent to grow their business. 

A room full of sprinters working on Drupal 8 and other initiatives

There is a lot of dedication and passion available from the regional folks. It was great to see people from many countries such as Mexico, Costa Rica, Argentina, Chile, Ecuador, Venezuela, Brasil etc. Most of them have vibrant local communities and you could see their interest in contributing by the sheer number of people that showed up for the sprints on Thursdays (67% attended, compare with 23% Austin and 34% Amsterdam!).

Sprinters at work

Unfortunately, WiFi couldn't make up for number of sprinters in the beginning, but after a cold start and passionate leading from the mentors, it turned into a productive day. On our side, Emma was especially excited to get patches committed for people that she had introduced into the contribution workflow as part of her Bartik mentoring work, Dagmar worked on a prototype to improve mobile table drag & drop UX and I worked on a first integration to scaffold Rules 8.x plug-ins with the shiny Drupal Console project that is exclusively maintained by Latin Americans.

Sprinters at work

 

Around the conference

While the primary goal is to meet, present and connect on Drupal, Bogotá was also a great opportunity to get to know an exotic country for many non-locals. People hiked Monserrate, travelled to the rain forests or Dagmar, Joel and me even did our first hike above 5000m at the Sierra Nevada of El Cocuy. Special thanks to our client Exped: their gears made sure that we could travel light while being prepared well for nights below 0°C.

Hiking up and above 5000m at Los Nevados de El CocuyHiking up and above 5000m at Los Nevados de El Cocuy

 

Sunrise at Los Nevados de El Cocuy

You can find more pictures on our flickr page. Also see Nick Vidal's and Jesus Manuel Olivas' blog posts. Thank you everyone involved in DrupalCon Latin America 2015. We are looking forward to more conferences like this one!

Categories: Drupal

Environments Tool

New Drupal Modules - 25 February 2015 - 6:39am

Environments is a module for dealing with different server environments, such as development, staging or production.

Usage
  1. Define one or more environments
  2. Define one or more tasks for each environment
  3. Export environments using Features
  4. Use the UI or Drush to switch environments
  5. Take a bow
Environment Tasks

Tasks are operations which get executed whenever an environment is entered, for example enabling/disabling modules, changing variable values, etc.

Categories: Drupal

TMGMT Zanata

New Drupal Modules - 25 February 2015 - 6:37am
Synopsis

TMGMT Zanata is a plugin for Drupal's Translation Management Module TMGMT. The plugin allows TMGMT to send content to a configured Zanata project for translation, and can download translations as they are ready.

Zanata is a web-based system for translators, content creators and developers to manage localisation projects (see zanata.org).

Categories: Drupal

Blink Reaction: Drupal 8, Console, Flag and Blink at Drupalcon Bogota

Planet Drupal - 25 February 2015 - 6:31am

After a great week in Bogota and some time to reflect I can say the first DrupalCon in Latin America was even better than I expected - yes it did feel more like a DrupalCamp than a DrupalCon - but it was still a great event! The quality of sessions were very good and as usual the greatest part was the chance to get together with a lot of friends from all over and especially Latin America.

Here my highlights:

Training: 

Our Community Trainings - Intro to Symfony, Getting Ready for D8

Categories: Drupal

Noindex for local pages without translation

New Drupal Modules - 25 February 2015 - 6:30am

The module prevents search engines (google, bing, yahoo etc) from indexing pages on local sites that do not have local translations / variations of the content. The avoids the site being penalised for duplicate content (page titles, meta description and content).

Categories: Drupal

Entity Panels

New Drupal Modules - 25 February 2015 - 6:30am

This module displays entities using panels and layouts. It allows to define different panel settings for any view modes of any entity types and any entity bundles.

This module is similar to Panelizer, but avoids its complexity. The main difference: Panelizer module allows to provide different configuration for distinct entities, while Entity Panels module provides single configuration for the whole view mode of the entity bundle.

Categories: Drupal

Trim

New Drupal Modules - 25 February 2015 - 6:04am

Trim strips all leading and trailing whitespace from all fields in all form submissions.

The module trims prior to validation, so for instance if you have an integer field and a person entering data fat-fingers a space after a number, he gets a successfully saved node rather than an error message about invalid input.

Categories: Drupal

Typed Entity

New Drupal Modules - 25 February 2015 - 4:18am


Use typed objects for your Drupal entities.

This module provides a simple way to treat you existing entities like typed objects. This will allow you to have a more maintainable and easier to debug codebase.

Categories: Drupal

Annertech: Create the WOW Factor with Drupal - Part 3 of 5

Planet Drupal - 25 February 2015 - 3:39am
Create the WOW Factor with Drupal - Part 3 of 5

In the first two installments of this series we looked at a general introduction to creating WOW with Drupal and adding some "Technical Wow". Today's let's tackle ...

Creating Wow - Aesthetic

This is part 3 of a 5 part series. Read the rest of the series here.

Categories: Drupal

CiviCRM Blog: Help get CiviCRM firing with Drupal 8 beta

Planet Drupal - 24 February 2015 - 9:35pm

Can you help Fuzion take the Drupal 8 integration module that was developed as part of 2014 Google Summer of Code and get it working with the most recent version of Drupal 8 and publicly available for testing?

Getting CiviCRM ready for Drupal 8 was always going to be a task with many stages. Thanks to the funding from the Google Summer of Code 2014 in August last year Torrance, was able to get CiviCRM functioning well on what was then the latest alpha of Drupal 8. Highlights of this work included a native, Drupal-side installer for CiviCRM, Views integration using CiviCRM to discover the database schema (cutting the Views module from 15,000 lines to code to under 2,000), and a set of integration tests for both CiviCRM and Views.

But as Drupal 8 has continued active development, many core APIs have changed and ….. the integration has regressed.

Lots of these changes are relatively minor: during alpha there were still plenty of structured arrays hanging around which have now mostly been moved into well defined interfaces; or similarly plenty of hard dependencies on object classes have been abstracted into interfaces. There’s also been a few slightly more significant code changes, with several hooks that were still hanging around having been pulled into the new plugin system for example.

Drupal 8 is now at beta 6 and is becoming much more stable; APIs have settled down and the code churn is much reduced. Now is a good time to work through the existing Drupal 8 integration code, update function signatures to match the new interfaces, and get CiviCRM working correctly on Drupal 8.

By getting through this next tranche of work we can set the ground for thorough testing of the module in the lead up for Drupal 8.0 final.

Fuzion is proposing to fund 1 hour for every 4 hours funded for the next tranche of 50 hours of work (our estimate for getting Drupal and CiviCRM playing nicely enough that we can get this pushed out). So yes we are looking for others in the CiviCRM community to chip in and help fund this important work to make sure CiviCRM is set for Drupal 8.

Can you help us push on with this next stage so we can get the integration available for public testing? If so please drop by this page and chip in.

Categories: Drupal

ThinkShout: Join ThinkShout for Drupal Day and the NTC

Planet Drupal - 24 February 2015 - 4:00pm

NTEN’s Nonprofit Technology Conference is nearly upon us! We’re gearing up to ship out to Austin, and we’re putting the finishing touches on Drupal Day. This is one of our favorite events of the year, as it’s when we get to meet up with many of our nonprofit partners, learn about new organizations and their causes, and share our expertise with the folks that need it to further their missions. We’re especially excited about the Drupal Day we’ve been coordinating for the last several months.

What’s Drupal Day? Well, the name pretty much gives it away, but specifically, it’s a full-day, pre-conference event that we’ve been organizing for the past few years. It’s full of Drupal trainings, discussions, and nonprofit technology staff sharing their successes with their community. Breakout session topics vary from content strategy, accessibility, fundraising, CRMs, design, and more, all led by Drupal experts. The day concludes with our keynote presentation on the future of Drupal and Drupal 8 by Zack Rosen, CEO of Pantheon. All Drupal Day attendees and speakers are invited to join us for a sponsored Happy Hour at the Brass House that evening. Want to stay in the loop on Twitter? Look for the hashtag #15NTCDrupal. Of course, Drupal Day wouldn’t be possible without the help of its co-sponsors, Aten Design, Forum One, Gorton Studios, Message Agency, and Zivtech.

That’s not all we’re up to, though. This year, you can find the ThinkShout team at booth #301 in the Science Fair on Wednesday and Thursday. Our friends at MailChimp couldn’t attend the NTC this year, but they made sure you wouldn’t go home empty handed. Stop by our booth for your NTC MailChimp swag, and come talk to us about how we’re integrating Drupal with MailChimp. We’ve also got a few ThinkShout goodies we’ll be handing out, so be sure to stop by. We’re happy to discuss just about anything under the sun.

This has been a big year so far for ThinkShout’s open source contributions. We’re particularly thrilled about our recent release of RedHen Raiser, the first peer-to-peer fundraising tool built on Drupal and RedHen. This is something we’re very excited to share with the nonprofit world, and we’d love to talk to you more about it at our booth.

You'll also be able to see some of the ThinkShout team in action as part of the NTC programming. On Thursday, March 5th, catch Lev Tsypin on the panel "Sync All the Things! How Progressive Nerds are Changing the Future of Political Data and Integration" at 3:30 p.m. On Friday, March 6th at 10:30 a.m., Brett Meyer will be co-leading the session “Content Strategy 101” with Katie Carrus from the Humane Society Legislative Fund. Brett will also be co-leading the session “Managing a Tech Project (Or Two or Three)” with Lisa Goddard from the Capital Area Food Bank of Texas, Melissa Barber and Brian Pickett from North Peak Solutions on March 5th at 1:30 p.m.

Don’t forget to follow us on Twitter @ThinkShout for our real time updates. Feel free to tweet us questions, or just say hi! (You can totally do that in person, too.) We’ll see you in Austin!

Categories: Drupal

5 things a government can do to grow its startup ecosystem

Dries Buytaert - 24 February 2015 - 11:15am

Building a successful company is really hard. It is hard no matter where you are in the world, but the difficulty is magnified in Europe, where people are divided by geography, regulation, language and cultural prejudice. If governments can provide European startups a competitive advantage, that could come a long way in helping to offset some of the disadvantages. In this post, I'm sharing some rough ideas for what governments could do to encourage a thriving startups ecosystem. It's my contribution to the Belgian startup manifesto (#bestartupmanifesto).

  1. Governments shouldn't obsess too much about making it easier to incorporate a company; while it is certainly nice when governments cut red tape, great entrepreneurs aren't going to be held back by some extra paperwork. Getting a company off the ground is by no means the most difficult part of the journey.
  2. Governments shouldn't decide what companies deserve funding or don't deserve funding. They will never be the best investors. Governments should play towards their strength, which is creating leverage for all instead for just a few.
  3. Governments can do quite a bit to extend a startup's runway (to compensate for the lack of funding available in Belgium). Relatively simple tax benefits result in less need for venture capital:
    • No corporate income taxes on your company for the first 3 years or until 1 million EUR in annual revenue.
    • No employee income tax or social security contributions for the first 3 years or until you hit 10 employees. Make hiring talent as cheap as possible; two employees for the price of one. (The cost of hiring an employee would effectively be the net income for the employee. The employee would still get a regular salary and social benefits.)
    • Loosen regulations on hiring and firing employees. Three months notice periods shackle the growth of startups. Governments can provide more flexibility for startups to hire and fire fast; two week notice periods for both incoming and outgoing employees. Employees who join a startup are comfortable with this level of job insecurity.
  4. Create "innovation hubs" that make neighborhoods more attractive to early-stage technology companies. Concentrate as many technology startups as possible in fun neighborhoods. Provide rent subsidies, free wifi and make sure there are great coffee shops.
  5. Build a culture of entrepreneurship. The biggest thing holding back a thriving startup community is not regulation, language, or geography, but a cultural prejudice against both failure and success. Governments can play a critical role in shaping the country's culture and creating an entrepreneurial environment where both failures and successes are celebrated, and where people are encouraged to better oneself economically through hard work and risk taking. In the end, entrepreneurship is a state of mind.
Categories: Drupal

Metal Toad: Drupal 7 Views Preview Shows Different Results

Planet Drupal - 24 February 2015 - 10:46am
Drupal 7 Views Preview Shows Different Results February 24th, 2015 Slavko Pesic

OK, so you are a site builder or a privileged role building a view. In the preview you see a certain result set, but regular and/or anonymous users see only subset of those results or no results at all.

You checked all your basics. Views permissions look good; Content permissions look correct as well. You double checked above by previewing nodes included in the view (same for related nodes if any) as a regular or anonymous user. But, alas, they are not seeing expected view results. This issue caused me a lot of grief and made me believe in gremlins for a minute, so I hope this blog post saves you some time and few gray hairs.

If you are experiencing similar issue and your case meets the following criteria:

  1. You are using entityreference module and there is a relationship between two entities via field entity reference.
  2. Your view includes those entities and joins the tables via relationship.
  3. You use one of the modules that works with node_access (e.g. content_access, og_access etc.). You can check node_access table in the database and if you see more than one entry in that table, you meet this criteria.
  4. Entity reference field which you use to form view relationship between your entities is not a required field and there are some nodes without reference.

Then this post applies to your case (skip to the bottom for solution).

In my scenario this occurred, during local testing of a D7 to D7 migration and the offending content and view worked just fine on the source D7 website. Same versions of core and all modules involved. To make things more interesting that view was a services_view and was used to generate RESTish endpoint. I had no obvious suspects. It can be many different things. Could be a bug in services, views, entityreference or something getting lost during migration. It is my first time writing migration scripts so it's very likely. Least suspicious in that list is Drupal core. This somewhat complex relationship clouds my google foo and I'm not really finding much. I scanned through each of the module's issue queues, but I'm failing to find anything similar to issues I am having. This increased my suspicions that it is probably something with my migration scripts.

It was time to roll up the sleeves and get the good ole step debugger and follow drupal execution path, recursive calls, inspect memory and generated queries on both websites and find out what's different. After hours of staring at code, refining breakpoints and looking at different drupal configs and maze of join queries I noticed something. Destination D7 had one of the subqueries altered via node_query_node_access_alter while the source didn't. In addition, this is where the query checked for existence of referenced entity's id, but didn't check for null values. Given that my view didn't enforce relationship, this was a drupal core bug.

If we have a left join, that is 'Require this relationship' is not checked (inner join otherwise), then the null value for referenced entity should be a valid one. Awesome, I need to write a core patch and check for this condition. This is super exciting. My first core contribution, my time to shine... Before I submit a new core issue and a patch, let me look at the existing queue and see if someone posted about it there. Now that I know what I'm looking for it only takes one search and I find the issue from 2 years ago: https://www.drupal.org/node/1969208.

The Drupal community delivers again. While I was a bit disappointed that I didn't get to write the patch, I found some consolation in the fact that I wasn't the only one struggling to figure this one out. Couple of days after I found this, one of the teams at Metal Toad ran into the same issue on a different project so I was able to help there as well.

While the working patch and tests for D7 are done, this won't get a D7 merge until the solution has been ported to D8. It might take a bit for merge to occur. I wrote this blog post to help increase visibility to the issue and perhaps save couple of hours of work for the readers.

Categories: Drupal

S1L: Drupal Commerce and Facebook Dynamic Product Ads

Planet Drupal - 24 February 2015 - 10:30am

On February 17, Facebook announced the launch of Dynamic Product Ads. You may want to pay attention to that, because it can be a very big deal to your customers that have Drupal Commerce based ecommerce stores.

According to Facebook:

"Facebook dynamic product ads helps you promote relevant products to shoppers browsing your product catalog on your website or mobile app."

"Dynamic Ads allow advertisers to create Link Ads that are rendered and targeted based on a set of products. The ads are rendered based on a template and filled in by product metadata. They are targeted based upon a set of actions that a person has taken on that product or product group.

For example, Dynamic Product Ads allow you to serve users an ad for exactly the product they have left in their cart, without creating an individual ad for each product SKU."

Here's an overview of how it works:

https://www.facebook.com/business/a/online-sales/dynamic-product-ads

Here's more information about the tracking / retargeting pixel:

https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/v2.2

Did I mention Facebook allows to dynamically turn off out-of-stock items and/or items that are already purchased?

Hello marketing awesomeness :D

Is there a module for that?

Not that I'm aware of. To my knowledge Drupal Commerce lacks a convenient way (a.k.a. a module) for

So I'm hoping by making you aware of the fact that these powerful Facebook marketing methods exist, that it allows you to provide value for your client,

and in the Drupal community spirit: that it will spark (at least) 1 developer to create a module for this. 

I'm happy to help beta-test its features, ponder about features and create a bit of documentation for it.

Cheers,

Sil

 

 

Category: Drupal Planet Drupal Commerce Facebook marketing
Categories: Drupal

DrupalCon News: Starting with the Front (End)

Planet Drupal - 24 February 2015 - 10:15am

Last year at DrupalCon, we proudly declared the front end to be the equal of our back end counterparts in practice and skill.

This year, we reaffirm the unique importance of our role: the front end is the intersection of presentation and structure, content and experience, and design and engineering.

Categories: Drupal

DrupalCon News: Deadline for Sessions, Trainings, and Grants & Scholarships is Friday

Planet Drupal - 24 February 2015 - 9:26am

As we hurtle through 2015, DrupalCon Los Angeles is appearing on the horizon — and with it, the deadline for session submissions. This Friday, February 27 at 11:59 PM PST is the last day to submit your proposals for sessions and training, and your last opportunity to apply for grants or scholarships if you need a little help getting to DrupalCon.

Categories: Drupal

Cruiskeen Consulting: Things we are working on

Planet Drupal - 24 February 2015 - 8:27am

We're working on a lot of new hosting infrastructure projects we though you might be interested in.  A lot of this is in preparation to provide a better development and hosting enviornment for Drupal 8. We are re-imaging web servers and other servers to do a better job for modern Drupal hosting.  Things you can look forward to include:

  1. Composer baked into our servers for easier development.
  2. Compass baked into the servers for better development with CSS pre-processing.
  3. Starting to move new servers into CentOS 7 to provide newer hosting binaries.
  4. Better support for resellers.
  5. Easier setup for use of varnish and memcache on our higher-end server packages.
  6. Better support for Drupal 8 on shared hosting.  We want to be able to offer a reasonably-priced environment for hosting Drupal 8 sites.

This is all part of our commitment to provide useful hosting services to the Drupal community. We expect that although Drupal 8 is great, it's going to require more specialized hosting in a lot of cases.  We're committed to the Drupal community, and look forward to getting more input from you on your Drupal hosting needs now and in the future.

Categories: Drupal

Annertech: Create the WOW Factor with Drupal - Part 2 of 5

Planet Drupal - 24 February 2015 - 7:30am
Create the WOW Factor with Drupal - Part 2 of 5

Yesterday, we began this series with a short introduction to creating the wow factor on a Drupal website. Today we'll look in a bit more detail at (drum roll) ...

Categories: Drupal

Drupalize.Me: Responding to Events in Drupal 8

Planet Drupal - 24 February 2015 - 6:05am

Events in Drupal 8 allow various system components to interact and communicate with one another while remaining independent, or decoupled. The event system is built on the Symfony event dispatcher component, and is an implementation of the Mediator design pattern. This post takes an in-depth look at how module developers can subscribe to events in Drupal 8.

Categories: Drupal
Syndicate content


Google+
about seo