Planet Drupal

Subscribe to Planet Drupal feed - aggregated feeds in category Planet Drupal
Updated: 1 hour 44 sec ago

Julian Granger-Bevan: How to diagnose a bloated Drupal database

Thu, 08/05/2014 - 21:47

Drupal websites use a database to store content and configuration relating to the running of the website.

For most installations (i.e., not large scale deployments), the database will be relatively compact. As an example, the websites that I maintain have databases between 5MB and 20MB. The specific size is affected by the amount of content on the websites and which modules are enabled.

Therefore, I was surprised to receive a notification from my host warning me that I was using over 2GB in database storage! Naturally I thought something must be wrong.

In this post, I'll share how I solved the issue for myself with some tips in case you suffer a similar issue yourself.

(Quick hint, use drush sqlc to run SQL commands against your website's database).


Database level

Find the affected database. Unless you are using a multi-site setup, each of your websites will be based in a different database.

SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema; +--------------------+---------------+ | DB Name | DB Size in MB | +--------------------+---------------+ | information_schema | 0.2 | | drupal_database | 1110.2 | +--------------------+---------------+ 2 rows in set (0.01 sec)

As you can see, my database user can only see two databases - information_schema containing SQL internals, and the main database (re)named drupal_database.


Table level

The next step is to find out what is causing that database to become so large. Drill-down to the tables within the database.

I found this "order by size" query helped a lot. It will only show the 5 largest tables, but this is where any problem will be. If there are no unusually large tables, it could just be that your website has grown large organically.

SELECT table_name, table_rows, data_length, index_length, ROUND(((data_length + index_length) / 1024 / 1024),2) 'Table Size in MB' FROM information_schema.tables WHERE table_type = 'BASE TABLE' ORDER BY data_length DESC LIMIT 5; +---------------------+------------+-------------+--------------+------------------+ | table_name | table_rows | data_length | index_length | Table Size in MB | +---------------------+------------+-------------+--------------+------------------+ | queue | 137362 | 1137704424 | 4017152 | 1088.83 | | field_revision_body | 1731 | 5259276 | 154624 | 5.16 | | field_data_body | 1731 | 5259276 | 145408 | 5.15 | | feeds_log | 27455 | 2712868 | 1131520 | 3.67 | | menu_router | 401 | 406128 | 76800 | 0.46 | +---------------------+------------+-------------+--------------+------------------+ 5 rows in set (0.01 sec)

In my example, the queue table occupies 98% of my the space used by this database. This is where the problem lies.

For context, Drupal uses the queue table to store tasks that need to be carried out on cron runs, and if cron is running successfully should contain no records or only a few that have arisen since the last cron run.


Task level

To find out what was going on, I looked at the types of tasks contained in this table:

SELECT name, COUNT(1) FROM queue GROUP BY name; +---------------------+----------+ | name | COUNT(1) | +---------------------+----------+ | feeds_source_import | 137498 | +---------------------+----------+ 1 row in set (0.07 sec)

There was only one task remaining, relating to the regular import of nodes from RSS feeds using the feeds module. Checking the settings for this importer, I realised that the import was scheduled to run every 15 minutes, yet cron only runs on this website once an hour. This means that each time cron ran, it could not get through all of the tasks required, and the backlog just started growing.

The long term solution was easy. Increase the frequency of the cron runs, and decrease the frequency of the node imports to ensure that cron is always on top of the tasks it needs to complete.

There is also the issue of the remaining bloated table. Whilst this will naturally diminish back to its normal size as cron catches up, if you're worried about how long this will take you could truncate the table once to ensure that the problem is solved. There's a risk with that though, if tasks in the table turn out to actually be required.



For context, here are the results of the same queries against a (healthier) website.

As you can see there are no tables that massively exceed the others in size, and the overall database size is under 10MB.

+--------------------+---------------+ | DB Name | DB Size in MB | +--------------------+---------------+ | information_schema | 0.2 | | drupal_database | 6.1 | +--------------------+---------------+ 2 rows in set (0.12 sec) +---------------------+------------+-------------+--------------+------------+ | TABLE_NAME | table_rows | data_length | index_length | Size in MB | +---------------------+------------+-------------+--------------+------------+ | field_revision_body | 423 | 1556716 | 47104 | 1.53 | | menu_router | 450 | 425076 | 80896 | 0.48 | | system | 390 | 313544 | 73728 | 0.37 | | field_data_body | 37 | 135968 | 18432 | 0.15 | | registry | 965 | 94016 | 53248 | 0.14 | +---------------------+------------+-------------+--------------+------------+ 5 rows in set (0.02 sec) +----------+ | count(1) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) Category: WebsitesTags: databaseDrupalDrupal Planet
Categories: Elsewhere

agoradesign: Fatal errors may cause infinite Feeds batch runs and exasperate you!

Thu, 08/05/2014 - 20:50

Every developer knows that kind of situations, where spend hours chasing a problem, that suddenly appeared, and the more you debug and dive into fixing it, t

Categories: Elsewhere

Aten Design Group: Someone Dropped a New Website in Your Lap, Now What?

Thu, 08/05/2014 - 18:38

At Aten, I tend to work on already live websites. Sometimes this means small bug fixes. Sometimes it encompasses information architecture, design work, a weeklong development sprint or working on the front end. In most cases my work is on a site I didn't build originally and often on a site Aten didn't build.

I started putting some notes together on some of the gotchas I run across when working on new-to-me sites. This will become a series of blog posts, but one always has to start at the beginning: getting the site working on your local environment.

We're assuming you already have some sort of a LAMP/MAMP/WAMP stack working.

Version Control

Next, you'll need access to the code to get it into your preferred version control system. Make sure you don't commit any settings.php files, the files directory, and possibly .htaccess if it contains server-specific settings. If using Git, remember that just because you've added these files/directories to .gitignore, doing git add . will add them anyway. If the code is already in a repository this step should be as easy as git clone [PATH]. If not, you might need to use something like tar czvf ~/everything.tar.gz public_html to make a copy of the whole file structure. I've also seen cases where JavaScript libraries are maintained as separate Git repositories within the main one. If those are in .gitignore a regular git clone of the main repo will skip these. I prefer to keep everything together by removing the entries in .gitignore. Run git clone on each library, delete each library's .git folder, and finally use git add to add them to the main repository.


After you have the code, you'll need to make a database export and import it. Drush sql-sync can do this, assuming [but that presumes] you have ssh keys and aliases configured and an already running site that drush can bootstrap. From the MySQL command line, create database [DATABASE_NAME]; use [DATABASE_NAME]; source ./[FILENAME.sql] always works. Don't forget to create a database user with something like: GRANT ALL ON database.* TO user@localhost IDENTIFIED BY 'someLongAndCompletelyRandomPassword'; FLUSH PRIVILEGES;.


Along with the database, you'll need to deal with the files directory. If you had to tar the whole thing you've already got many megabytes of files on your hard drive. If you want to avoid that, Stage File Proxy can help by downloading images from a production website as needed on a page by page basis. While this will help, there are some images it has problems dealing with. Another possibility is using Apache rewrites to load image resources from the production site.


My final steps are to add an entry to /etc/hosts for the new local domain, and an entry or new vhosts .conf file to direct that domain to the correct web root directory. Finally, flush DNS cache and restart apache. These steps will differ slightly, depending on your specific LAMP implementation.

Once we have the site up and running, it's time to make some improvements. Next time I'll discuss how to track down some specific situations when you know very little about how a site was built.

Categories: Elsewhere

Blink Reaction: How to Set up Symfony

Thu, 08/05/2014 - 17:23

Long-time Drupal developer Wes Roepken walks you through the steps involved in getting Symfony set up and ready to work.

Categories: Elsewhere

ThinkShout: What Nonprofits Can Learn About Content Structure… from Pearl Jam

Thu, 08/05/2014 - 17:00

Photo by Phil King, licensed under CC 2.0.

Pearl Jam have been posterboys for a lot of things, but probably not structured web content. Content strategists like to point to NPR’s Create Once, Publish Everywhere (COPE) framework, to large media outlets, sometimes to the U.S. government – but given the breadth of coverage (and budgets) available to those entities, making the move to fully structured content may seem daunting in the nonprofit context.

If Pearl Jam can do it, so can you.

The basic concept is this: by separating out the most important components of your content into “fields”, instead of dumping everything from images to embedded videos to pull quotes into a WYSIWYG editor, you’ll be able to :

  • Display your content responsively across devices;
  • Share it more easily with your affiliates and supporters; and
  • Create dynamic ways to surface relevant content and encourage engagement.

In a striking example of why tech folks shouldn’t be allowed to name concepts, creating fields to structure your content is affectionately known as the difference between making blobs and chunks.

If you use a modern CMS, you’ve already used structured content to a degree. The title of your page or post is almost always separate from the body. This allows you, at the most basic level, to build a dynamic page of blog posts that displays only the title and maybe a snippet of the body, which then links off to a detail page containing the full post.

The New York Times uses this concept, breaking out fields for author, publication date, and more for its news stories. Amazon has taken it to an entirely different level by assigning scores of categories to its products; when you narrow down your mattress search to a queen size goose down featherbed from Pacific Coast, you’re taking advantage of structured data (in the form of faceted search).

What Pearl Jam has done – and what every nonprofit should think about doing – is match the motivations their audience has in visiting their website to PJ’s own (organizational) goals and structured their site content so the two complement each other.

Pearl Jam’s core offering is music. People visit their website to find that music, either in the form of upcoming (or past) shows, lyrics, or songs they can buy. So, much of Pearl Jam’s website is structured around the concept of the song.

[Note that I don’t have any insider’s knowledge about the exact structure or software they’re using. This is just how we would do it if we built their site in Drupal.]

Practically every song Pearl Jam has ever recorded or performed live has a place on the website, and they’re all structured the same:

  • Title
  • Release Date
  • Composer
  • Artist
  • Image
  • Lyrics

That’s it. Everything else on that page, and much of the site, is built through the application of structured data.

If you look at an individual album, you’re actually looking at a different content type, which has its own structure:

  • Title
  • Release Date
  • Cover Image
  • Purchase Links
  • Body
  • Song [REFERENCE]

It’s that REFERENCE field that’s key. Every album is a collection of references to the individual songs, rather than list built by hand. (On Drupal, we’d probably use something like Entity Reference.) Clicking on an individual song takes you to its detail page.

It gets more interesting when you look at a Setlist, another structured content type:

  • Venue
  • Location
  • Date
  • Concert Poster Image
  • Product Links
  • Bootleg Image
  • Song [REFERENCE]
  • Live Image [REFERENCE]

A setlist is built up using the same song REFERENCE field as an album; each song exists as a single entity, but it can be referenced from hundreds of other pages (in the case of a classic like “Jeremy”).

All the way back in 2000, Pearl Jam started recording every show they did off the mixing board so they could sell high-quality recordings. While you can’t quite get every one of the 672 versions of “Alive” they’ve performed over the years, you can come pretty close.

Setlists include the all-important link to purchase a copy of an entire live performance.

This relational system has created endless connections between the Songs they’ve performed – their core content offering – and where and when they’ve performed them. By then layering on the ability to purchase copies of those concerts at any time, Pearl Jam has taken one of the primary motivations of their audience – to engage with PJ’s music – and tied it directly to their organizational goal of making money, without shoving that in your face.

It’s also worth noting that structured data has also allowed Pearl Jam to flesh out the detail pages for each of its content types with just a few lines of code.

On a song page, the “First Played”, “Last Played”, and “Times Played” lines are created dynamically, as is the list of every place and date it’s been performed. Tours are created by referencing each of the setlists. I imagine that the slider showing all of the album covers is created by pulling the cover image associated with each album (instead of being inserted by hand).

Once your content is structured, the ways you can reformat and display it are limited only by your imagination communications plan, your organizational goals, and your CMS. Oh, and it helps if you understand the motivations of your various audiences.

What’s your core content offering? Can you create a similar structure? Have you already?

And if anybody with PhotoShop skills wants to create that new poster for Pearl Jam, highlighting their mastery of structured content...

Categories: Elsewhere

Poplarware: The case for a small Drupal shop contributing to Drupal

Thu, 08/05/2014 - 15:27

Dries Buytaert, the CEO of Aquia and head of the open-source Drupal project, recently wrote a blog post about the business case for hiring a Drupal core contributor. Dries wrote about the measurable effect that a larger Drupal shop can realize from hiring a contributor full-time.

read more

Categories: Elsewhere

James Oakley: Updating Drupal core with bash and drush

Thu, 08/05/2014 - 14:55

Yesterday, Drupal 7.28 was released.

People rush to upgrade, knowing that there will be a tranche of bug-fixes that may resolve longstanding issues.

People hesitate to upgrade, because updating Drupal core is not as simple as we'd like.

Other times, the core update is a security release, and you can't afford to wait.

This does not need to be painful!!

Upgrading core in Drupal 7

You have probably read the official documentation on doing this. … Read more about Updating Drupal core with bash and drush

Blog Category: Drupal Planet
Categories: Elsewhere frontpage posts for the Drupal planet: Drupal 7.28 released

Thu, 08/05/2014 - 06:19

Drupal 7.28, a maintenance release with numerous bug fixes (no security fixes) is now available for download. See the Drupal 7.28 release notes for a full listing.

Download Drupal 7.28

Upgrading your existing Drupal 7 sites is recommended. There are no major new features in this release. For more information about the Drupal 7.x release series, consult the Drupal 7.0 release announcement.

Security information

We have a security announcement mailing list and a history of all security advisories, as well as an RSS feed with the most recent security advisories. We strongly advise Drupal administrators to sign up for the list.

Drupal 7 includes the built-in Update Manager module, which informs you about important updates to your modules and themes.

There are no security fixes in this release of Drupal core.

Bug reports

Drupal 7.x is being maintained, so given enough bug fixes (not just bug reports), more maintenance releases will be made available, according to our monthly release cycle.


Drupal 7.28 contains bug fixes and small API/feature improvements only. The full list of changes between the 7.27 and 7.28 releases can be found by reading the 7.28 release notes. A complete list of all bug fixes in the stable 7.x branch can be found in the git commit log.

Update notes

See the 7.28 release notes for details on important changes in this release.

Known issues

Changes made to the Update Manager module in this release may lead to performance slowdowns in certain cases (including on rare page loads for site visitors, if the site is using the automated cron feature). See the release notes for more information.

Front page news: Planet DrupalDrupal version: Drupal 7.x
Categories: Elsewhere

Dries Buytaert: The investment case for employing a Drupal core contributor

Wed, 07/05/2014 - 23:40
Topic: DrupalAcquiaBusiness

I've long been convinced that every well-run Drupal agency of 30 people or more can afford to hire a Drupal core contributor and let him/her work on Drupal core pretty much full-time. A healthy Drupal agency with 30 people should be able to do $5MM in revenue at a 15% net profit margin #1. This means they have $750k in profits that can be invested in growth, saved as reserves, or distributed among the owners.

There are many ways you can invest in growth. I'm here to argue that hiring a Drupal core contributor can be a great investment, that many Drupal agencies can afford it, and that employing a Drupal core contributor shouldn't just be looked at as a cost.

In fact, Chapter Three just announced that they hired Alex Pott, a Drupal 8 core maintainer, to work full-time on Drupal core. I couldn't be more thrilled. Great for Alex, great for Drupal, and great for Chapter Three! And a good reason to actually write down some of my thoughts.

The value of having a Drupal core contributor on staff

When Drupal 8 launches it will bring with it many big changes. Having someone within your company with first-hand knowledge of these changes is invaluable on a number of fronts. He or she can help train or support your technical staff on the changes coming down the pipe, can help your sales team answer customer questions, and can help your marketing team with blog posts and presentations to establish you as a thought-leader on Drupal. I believe these things take less than 20% of a Drupal core contributor's time, which leaves more than 80% of time to contribute to Drupal.

But perhaps most importantly, it is a crucial contribution that helps ensure the future of the Drupal project itself and help us all avoid falling into the tragedy of the commons. While some core contributors have some amount of funding — ranging from 10% time from their employers to full-time employment (for example, most of Acquia's Office of the CTO are full-time core contributors) — most core contribution happens thanks to great personal sacrifice of the individuals involved. As the complexity and adoption of Drupal grows, there is a growing need for full-time Drupal contributors. Additionally, distributing employment of core contributors across multiple Drupal organizations can be healthy for Drupal; it ensures institutional independence, diversified innovation and resilience.

Measuring the impact of a Drupal core contributor on your business

While that sounds nice, the proof is in the numbers. So when I heard about Chapter Three hiring Alex Pott, I immediately called Chapter Three to congratulate them, but I also asked them to track Alex's impact on Chapter Three in terms of sales. If we can actually prove that hiring a Drupal core contributor is a great business investment, it could provide a really important breakthrough in making Drupal core development scalable.

I asked my team at Acquia to start tracking the impact of the Drupal core contributors on sales. Below, I'll share some data of how Acquia tracked this and why I'm bullish on there being a business case.

For Acquia, high quality content is the number one way to generate new sales leads. Marketers know that the key to doing online business is to become publishers. It is something that Acquia's Drupal developers all help with; developers putting out great content can turn your website into a magnet. And with the help of a well-oiled sales and marketing organization, you can turn visitors into customers.

Back in December, Angie "webchick" Byron did a Drupal 8 preview webinar for Acquia. The webinar attracted over 1,000+ attendees. We were able to track that this single piece of content generated $4.5MM in influenced pipeline #2, of which we've managed to close $1.5MM in business so far.

Even more impressive, Kevin O'Leary has done four webinars on Drupal's newest authoring experience improvements. In total, Kevin's webinars helped generate $9MM in influenced pipeline of which almost $4MM closed. And importantly, Kevin had not worked on Drupal prior to joining Acquia! It goes to show that you don't necessarily have to hire from the community; existing employees can be made core contributors and add value to the company.

Gábor Hojtsy regularly spends some of his time on sales calls and helped close several $500k+ deals. Moshe Weitzman occasionally travels to customers and helped renew several large deals. Moshe also wrote a blog post around Drupal 8's improved upgrade process using Migrate module. We aren't able to track all the details yet (working on it), but I'm sure some of the more than 3,200 unique viewers translated in to sales for us.

Conclusion: investment returned, and then some

Obviously, your results may vary. Acquia has an amazing sales and marketing engine behind these core contributor, driving the results. I hope Chapter Three tracks the impact of hiring Alex Pott and that they share the results publicly so we can continue to build the business case for employing full-time Drupal contributors. If we can show that is not just good for Drupal, but also good for business, we can scale Drupal development to new highs. I hope more Drupal companies will start to think this way.


#1 I assumed that of the 30 people, 25 are billable and 5 are non-billable. I also assumed an average fully-loaded cost per employee of $125k per head and gross revenue per head of around $180k. The basic math works out as follows: (25 employees x $180k) - (30 employees x $125k) = $750k in profit.

There are 365 days per year and about 104 weekend days. This means there are 260 business days. If you subtract 10 legal bank holidays you have 250 days remaining. If you subtract another 15 business days for vacations, conferences, medical leave and others, you have 230 business days left. With a blended hourly rate of $130 per hour and 75% utilization, you arrive at ~$180k gross revenue per billable head.

I confirmed these numbers with several Drupal companies in the US. Best in class digital agencies actually do better; they assume there are 2,000 billable hours in a year per head and maintain at least a 85% chargeability rate (i.e. 1,700 billable hours per head). Many companies do less because the maturity of their business, the market they are in, their geographic location, their ambitions, etc. It's not about what is "good" or "bad", but about what is possible.

#2 "Influenced pipeline" means that the content in question was one factor or touch point in what ultimately lead potential customers to become qualified sales leads and contacted by Acquia. On average, Acquia has 6 touch points for every qualified sales lead.

Categories: Elsewhere

DrupalCon Austin News: Drupal in Education Summit, June 2

Wed, 07/05/2014 - 22:02

Do you work at a college, university, or k-12 school? If so, then we invite you to the Drupal in Education Summit to be held at the University of Texas at Austin on June 2, from 9am-4pm (leaving you plenty of time to make the DrupalCon opening reception afterwards)!

Categories: Elsewhere

Drupal 8 and iOS: Drupal 8 and iOS

Wed, 07/05/2014 - 19:23
Drupal 8 and iOS

In the first week of March of 2014, Google announced Google Summer of Code and I started to search for a project that suits my skill and I found one with the title “An Example iOS application that connects to Drupal 8 via REST web services”. 

And that day I joined Drupal as a community member. As of now we all are so excited about Drupal 8. I am working on this project and I will try to build an example app that runs on iOS 7.1 and can view, create, update and delete content from an iOS device. If time permits I will try to add more functionalities to the app.

I have got good mentors from the Drupal community Jeff Linwood (jefflinwood) and Jingsheng Wang (skyred) for this project. As a part of this project I have created a simple site with Drupal 8 that has few pages with 3 simple fields and our aim is to manipulate these pages with the iOS app. I have deployed Drupal 8 on OpenStack from RedHat. This is the URL for my site

REST services for Drupal 8 are new, so I will try and provide good examples that can describes how to use it. 

In Drupal 8 alpha 11 some problems with REST are resolved for example no more “entity” word should required to access REST service i.e instead of “entity/node/1” you can now access it with “node/1” (more RESTful way) and I appreciate guys working behind it. 

On the iOS side, I am using NSURLSession to connect my app to the site. This set of classes are introduced by Apple in 2013 with iOS 7. REST services on Drupal 8 can serialize data in JSON, XML or HAL_JSON formate and I have used this JSON object to display content from the site. I have upload my code on so other interested community member can review it and help me to make this more useful. You can find the code at TipsAndTricksCFNetworkingDrupal.

Categories: Elsewhere

OpenConcept: OC spring Vegetable Gardens

Wed, 07/05/2014 - 18:44

There are many great things about working for OpenConcept, but two that I appreciate in particular are the homemade lunches we take turns making for everyone and share each day, and the fact that we are encouraged to follow our own interests. OC always gets behind you on your pet projects.

Personally, I love to grow my own food and have been encouraging urban farming initiatives locally here in Ottawa for some time now. In 2013, I was pleased to be able to start a garden here at OC headquarters to supplement the garden space I have at my own home. The idea is that from the veggies grown at OC some will come home with me and the rest will be used for our communal lunches. Last year the garden wasn't built until pretty late in the season, but we were able to grow a few zucchinis, some peppers and a little swiss chard. This season I've got a jump on the planting. The gardens are now prepared and there are a few things growing already. I even have a plan for crop rotation as things grow and finish as the season progresses. Woot, woot!

Above is a photo of what our garden space looks like. There is a 7 foot by 5 foot raised bed and a narrow garden bed along the backside of the building.

Along the back wall, peas have been planted as well as some purple-green beans. There is also going to be a small sport for mixed greens to grow under the window to the left.

In the raised bed so far arugula, breakfast radish, turnips and carrots have been seeded. The garlic and onion sets are already  poking through the soil.

We also have a rain barrel set up.

Anyway, I thought I would let the world know a little more of what we are all about and what we are up to here at OC. I will try and post a few updates as the season progresses with some nice photos of delicious veggies growing. Happy spring planting everyone!



AttachmentSize OpenConcept 7 foot by 5 foot raised garden bed.141.61 KB Spring garlic sprouting in May 2014238.41 KB OpenConcept's water barrel.187.18 KB Topic: 
Categories: Elsewhere

Mediacurrent: Choosing Drupal as a Content Management Framework

Wed, 07/05/2014 - 17:35

Recently I had the opportunity to speak at ConvergeSE in Columbia, SC. I was pleasantly surprised by the number of attendees and the excitement at the conference. We had a lot of fantastic keynote speakers including Ethan Marcotte, Jenn Lukas, and Chris Coyier to name a few. Watch out SXSW!

Unlike most of the Drupal conferences I attend, this one was broad and included tracks such as design, gaming, front-end, makers, UX, development, and business & marketing. So I felt I must wave the Drupal banner & represent! Below is my presentation, "Choosing Drupal as a Content Management Framework for Your Next Project." I covered questions such as:

Categories: Elsewhere

Steindom LLC: How to export and import Drupal nodes

Wed, 07/05/2014 - 17:14

There are lots of ways to export configuration from one Drupal site and import into another; however, there are few ways to do the same with content. Here's a quick tip which has worked well for me.

I've tried several contrib modules to export content from one site and import into another, with varying levels of success, such as Node export and UUID Features. However, in my use cases, these solutions created more problems than they solve.

For example, on one project I have to create Webform nodes in a development environment, and then export these into code so they can be deployed upstream. After wrestling with the modules above, I wrote a simple script you can execute at /devel/php:

// Enter node NID to export.
$nid = 55;

// Use Drupal's export utility to convert the object to code.
include_once DRUPAL_ROOT . '/includes/';
$export = drupal_var_export(node_load($nid));

// Strip node NIDs and VIDs, so it imports cleanly.
$export = preg_replace("/'(n|v)id' => '?\d+'?,/", "'$1id' => NULL,", $export);

// Print code needed to import node.
dpm('$node = ' . $export . ';' . "\n" . 'node_save($node);');

You can then include the displayed code in your .install file. It will create the node, and let Drupal auto-populate the NID and VID.

Submitted by Joel Stein on May 7, 2014.Tags: Drupal Planet, Drupal, Drupal 7
Categories: Elsewhere

Gábor Hojtsy: Learn Drupal from the best by making it better at sprints

Wed, 07/05/2014 - 15:46

Drupal is right in the middle of web technology, an ideal integrator of all kinds of things. Just like PHP itself it may be clunky here and there but it is a very efficient tool to build great experiences. And even if you are a great JS developer or a pro PHP person, maybe you have mad debugging skills, you always have something to learn. Now there are great books, sometimes even better videos, but nothing beats hands-on learning. When you get together with other people working on the same thing you learn so much about how they work and even if you gain no new knowledge about programming per say, you learn new tricks and ways to achieve things:

Two days working with the Drupal Community in #DrupalDevDays help you to learn more than one week working alone at home :)

— Javi Santos (@javisr) March 27, 2014

Not only that but you can also look into how the tools you work with are made and that all of us are human:

Greatest thing about code sprints: Hearing respected core devs say "I don't understand that." "Me neither." We all learn. #drupaldevdays

— Marc van Gend (@marcvangend) March 28, 2014

Finally, by helping to improve the tools you use, you gain much better knowledge about them. Close to the start of my web involvement I worked a lot on translating the PHP documentation to Hungarian and I got into Drupal fixing core issues for translations. By becoming one of the thousands building the system you use you also gain more credibility when you are looking for help in your weak areas as well:

after almost a decade of #drupal love i just became a real drupalist at #drupaldevdays - i am now a core contributor!

— aboros (@hunaboros) March 27, 2014

But not everyone can do this right? You need to be a professional programmer and pay expensive fees to get into events? Wrong! So wrong! There are always sprints around the globe and more and more local Drupal events are announced every day. Starting out with a simple issue on a one day sprint is a great start. Drupal can always be improved in all kinds of ways whether that is accessibility testing, documentation, perfecting button colors and radiuses or finding and documenting bugs. All of those are great contributions.

Drupal Dev Days sprint photo by Amazee Labs

The best places to immerse yourself in contribution are multi-day sprints though. If you have any opportunity to go to those, I would definitely suggest you join one. Why? It takes a fair bit of time to get set up, understand the issue, start providing a solution and even though at the end of the one day sprint, you will promise to get back to it a week later from home, it is almost certainly not going to happen. There is nothing wrong with you, you just have other priorities when you get out of sprint-mode. So for ideal involvement pick a multi-day sprint. It is not only that you have more time to work on things, you can get to know the people better as well on the social events. Some conferences, especially DrupalCons include extended sprints before/after the event. If you just go to the main conference days, you have much less chance to interact with people who shape the future of Drupal, while at the extended sprints, you can get involved and work with them real time. How is that for growing your potential?

Here are some examples of events with multi-day sprints where my friends from the multilingual initiative will be sprinting, feel free to add more in the comments:

DrupalCamp Spain in Valencia is coming up in a little over a week on May 16-18th. All three days have sprinting opportunities and some of the leaders from multilingual, frontend and migrations will be there!

Some people may only be aware of the Friday sprint at DrupalCons. Get a lot more out of the event by being involved with the pre and post sprints as well. DrupalCon Austin sprints last from as early as May 30 to as late as June 8th. Likewise DrupalCon Amsterdam sprints will be on from the 27th of September to as late as 5th of October. But DrupalCons are expensive, no? Well, there is no ticket needed to attend on the days when there is only sprinting, that is the pre/post sprint days and the Friday sprint. So if you join at the end, there is 3 days of consecutive working with the Drupal community for no charge where the people you interact with have no conflicting schedules to do or see sessions. How is that for hands-on experience?

Hope to see you at one of these events and other sprints in 2014 and onwards! Learn Drupal by getting involved, it is for the benefit of us all!

Categories: Elsewhere

DrupalCon Austin News: Announcing Our Keynote Speakers

Wed, 07/05/2014 - 15:46

We’re thrilled to announce that the keynote speakers for DrupalCon Austin have been selected. In keeping with tradition, the usual Driesnote will take place on Tuesday morning, while on Wednesday and Thursday we’ll enjoy keynotes from Erynn Petersen and Hugh Forrest.

Here’s what’s in store:

Tuesday - June 3

Categories: Elsewhere

Nikro: Moldcamp - only 10 days left

Wed, 07/05/2014 - 15:07

We are getting closer and closer the our long-waited event - Moldcamp. What is Moldcamp? Well, it our very first DrupalCamp held in Moldova. We've worked your butts off to make it as nice as we can. Let's see some stats, details, sessions, etc.

Categories: Elsewhere

Code Karate: Drupal 7 Nodeblock module

Wed, 07/05/2014 - 13:15

The Drupal 7 Nodeblock module is a simple but handy module that can be used to turn nodes into blocks on your Drupal 7 website.

Categories: Elsewhere