In a large website with many nodes, stop using the node_load_multiple function. It potentially limits the site growing.
According to the document: "This function should be used whenever you need to load more than one node from the database." But, I want to say that we should avoid using this function as this open the door to system crash in the future.
I had written a blog before Design a Drupal website with a million nodes in mind. I had used this function as an example. It is true that node_load_multiple function enhance the performance. But, it comes with a price. When we load thousands of node into the memory, it exhausts the web server memory instantly. Then we get this infamous message: "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate XYZ bytes) in ...".
This issue brought me to an attention when I am reading the code done by one of the well-known Drupal shops. In one of the recently launched high-profile project, the function is used to load all the show nodes in the system. It sounds to be troublesome to me at the beginning. We can not load all nodes if we are not sure how many it will be? Where there are a small amount of node in the system, that is fine. But if it is for a system there are over hundred thousand nodes, that is a big problem. As time goes by, we add more shows into the system; The utility function needs more memory to handle it. The physical memory limits the ability to add infinity show nodes into the system.
What is the best way to handle this situation? Avoid using the node_load_multiple function. If we have to use the node_load_multiple, limit the number of the node for node_load_multiple to load.
Discover the post on social shopping projects in Drupal with some of the best secrets
of ecommerce website development for you ;)
In this week’s REST Easy tutorial, we tackle the process of adding entity references to your API endpoints. Entity references create relationships between two separate data structures in Drupal. Exposing that link within your API is critical to providing a comprehensive content model.
Training Acquia employees how to use Drupal 8 had two purposes. First, there was the obvious need for our company – one that specializes in building and delivering a digital experience using Drupal – to get everyone up to speed on the new version.
But we also felt our training sessions had a larger purpose: to inform the larger Drupal community on the ins and outs, not to mention joys and pains, of the updated version. So as we embarked on our long training program of nearly 50 employees, we documented our progress.Tags: acquia drupal planet
It is fitting that in football-crazed Barcelona, although we will have a plethora of tech talks, that we have at least one talk that highlights the sport! Whether you’re a fan of FC Barcelona or any football team for that matter, it is pretty impressive what a team can accomplish together. And although we aren’t goalies and midfielders, Adam Onishi's (onishiweb) talk will highlight how front-enders and Drupalers can go for the gold together.
The monthly Drupal core bug fix/feature release window is scheduled for this Wednesday. However, there have not been enough changes to the development version since the last bug fix/feature release to warrant a new release, so there will be no Drupal core release on that date. (I had hoped to get a release done, but scheduling issues plus the work involved in putting out a large security release in August made it impossible.) A Drupal 7 bug fix/feature release during the October window is likely instead.
Upcoming release windows include:
- Wednesday, September 16 (security release window)
- Wednesday, October 7 (bug fix/feature release window)
We recently teamed up with Drupalize.me to produce a brand new (free!) video tutorial: "Introduction to RedHen CRM."
In this introductory video, you'll tour RedHen CRM's central features, get a detailed walkthrough of the setup process, and learn a few of RedHen's cool tricks, like duplicate management (a pet feature of mine). This is a great resource for anyone who is looking for a step-by-step guide to setting up and configuring RedHen, or just wants to learn more about it!
Continuing in our series of integrating CRMs with Drupal, we're now going to take a look at CiviCRM, an open-source, web-based CRM aimed at charities and non-profits which integrates closely with Drupal, Joomla and WordPress.
This week, we published the first post about Drupal on GoDaddy.com: "What you need to know about Drupal 8".
GoDaddy is a really fascinating company, but most of you probably didn't expect them to be interested in Drupal.
You probably know some of the GoDaddy story.You've seen the commercials with half-naked women. You may know about Bob Parsons, their ex-CEO, who was a public relations genius ... until he wasn't. Parsons built an empire on using SuperBowl commercials, NASCAR sponsorship and risqué advertising to sell hosting and domain names. But, in later years, Parsons made several major PR gaffes. And, it didn't help that GoDaddy also had a reputation for poor-quality hosting. If you've been to a tech conference, you've probably heard speakers making jokes at GoDaddy's expense.
Have you ever wondered how Drupal does what it does? Good, me too. In this series of posts, I'm going to explain what Drupal is doing behind the scenes to perform its magic.
In Part 1, we'll keep it fairly high level and walk through the path a request takes as it moves through Drupal. In later parts, we'll take deeper dives into individual pieces of this process.Step 0: Some background information
For this example, let's pretend that George, a user of your site, wants to visit your About Us page, which lives at http://oursite/about-us.
Let's also pretend that this page is a node (specifically, the node with nid of 1) with a URL alias of about-us.
And to keep things simple, we'll say that we're using Apache as our webserver, and there's nothing fancy sitting in front of Drupal, such as a caching layer or the like.
So basically, we're talking about a plain old Drupal site on a plain old webserver.Step 1: The request hits the server
There's some pretty hot action that happens before Drupal even sees the request. George's browser sends a request to http://oursite.com/about-us, and this thing we call the internet figures out that that should go to our server. If you're not well versed on how that part happens, you may benefit from reading this infographic on how the internet works.
Once our server has received the request, that's when the fun begins. This request will land on port 80, and Apache just so happens to be listening on that port, so Apache will immediately see the request and decide what to do with it.
Since the request is going to oursite.com then Apache can look into its configuration files to see what the root directory is for oursite.com (along with lots of other info about it which is out of scope for this post). We'll say that the root directory for our site is /var/www/oursite, which is where Drupal lives. So Apache is going to send the request there.Step 2: The .htaccess file
But Drupal hasn't taken over just yet. Drupal ships with a .htaccess file which is a way of telling Apache some things. In fact, Drupal's .htaccess tells Apache a whole lot of things. The most important things it does are:
- Protects files that could contain source code from being viewable, such as .module files or .inc files, both of which contain PHP.
- Allows requests that point directly to files in the filesystem to pass through without touching Drupal.
- Redirects all other requests to Drupal's index.php file.
It also does some other fancy things such as disabling directory indexes and allowing Drupal to serve gzipped CSS and JS, but those are the biggies.
So, in our case, Apache will see that we're looking for /about-us, and will say:
- Is this request trying to access a file that it shouldn't? No.
- Is this request directly pointing to a file in the filesystem? No.
- Then this request should be sent to index.php!
And away we go...Step 3: Drupal's index.php file
Finally, we have reached Drupal, and we're looking at PHP. Drupal's index.php is super clean, and in fact only has 4 lines of code, each of which are easy to understand.Line 1: Define DRUPAL_ROOT
php define('DRUPAL_ROOT', getcwd());
This just sets a constant called DRUPAL_ROOT to be the value of the current directory that index.php is in. This constant is used all over the place in the Drupal core codebase.
In our case, this means that DRUPAL_ROOT gets set to /var/www/oursite.Lines 2 and 3: Bootstrap Drupal
php require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
These lines run a full Drupal bootstrap, which basically means that they tell Drupal "Hey, grab all of the stuff you're going to need before we can get to actually handling this request."
For more information about the bootstrap process, see Part 2 of this series.Line 4: Do everything else
This simple looking function is where the heart and soul of Drupal lives. For more information about what happens in this ball of wax, visit the Menu Router chapter.
Time has almost come! The yearly Europe DrupalCon will start on September 21nth 2015 in Barcelona. It will be my fist time on a DrupaCon even if I am working with Drupal for 7 years now. Don't ask me why, there are no excuses.
As a frontend developer and a freelancer it was too hard for me to select the sessions to attend. DrupalCon hosts the best of the best talks for Drupal out there and the benefits for Drupal *ers is enormous. Sessions will be recorded but live sessions are these that matter.
So, after a deep review on each session I decided to attend sessions that are dealing with the keywords below (notice that order matters):
- CI (Continuous Integration) and CD (Continuous Development)
- Drupal 8 plug system
- Headless Drupal
I am sure that with some sessions (eg these related with Docker or AngularJS) there will be a "crowding". Remember that. It happens everywhere, from local meetups to large events. Docker, Headless and Devops are here to stay and will bother us for years. Thankfully Drupal with the new 8.x version is "up to date" with the new technologies and methods and the DrupalCon shows that movement clearly.
Here is My Schedule (I know that there are duplicates or even triplicates but I will decide last minute. Maybe after asking other attendees...)
09/22/2015 - 11:00-09/22/2015 - 12:00 Session Speaker(s) Experience level Room Symfony for Drupal developers Crell Intermediate 115
09/22/2015 - 13:00-09/22/2015 - 14:00 Session Speaker(s) Experience level Room Drupal development with Vagrant 128 Fundamentals of Front-End Ops prestonso Intermediate 111: Adyax Docker powered team and deployment daven Intermediate 118-119: Platform.sh
09/22/2015 - 14:15-09/22/2015 - 15:15 Session Speaker(s) Experience level Room Drupal 8 Plugin Deep Dive EclipseGc Advanced 116: Pantheon Headful Drupal nod_ Intermediate 122-123: Interoute
09/22/2015 - 15:45-09/22/2015 - 16:45 Session Speaker(s) Experience level Room Composer and Drupal 8 webflo, tstoeckler Intermediate 122-123: Interoute Dependency Injection, what, why, how and when mr_r_miller Intermediate 115
09/22/2015 - 17:00-09/22/2015 - 18:00 Session Speaker(s) Experience level Room Expose Drupal with RESTful e0ipso Intermediate 112: Exove Caching at the Edge: CDNs for everyone Wim Leers, Fabianx Advanced 117: Acquia
09/23/2015 - 10:45-09/23/2015 - 11:45 Session Speaker(s) Experience level Room Local vs. Remote Development: Do Both by Syncing Your Site From Kitchen to Cloud With Jenkins SolomonGifford Beginner 116: Pantheon Prototypes and Drupal: from designing in-browser to implementing custom templates ygerasimov, mortenc Intermediate 111: Adyax
09/23/2015 - 13:00-09/23/2015 - 14:00 Session Speaker(s) Experience level Room Docker and DevOps – Building platforms globally William Morrish - Interoute Intermediate 120-121 Linked Data 101: The Non-Terrifying Intro to Semantic Content nozurbina Intermediate 115
09/23/2015 - 14:15-09/23/2015 - 15:15 Session Speaker(s) Experience level Room Drupal and Security: what you need to know scor, klausi Intermediate 111: Adyax
09/23/2015 - 15:45-09/23/2015 - 16:45 Session Speaker(s) Experience level Room Hassle-free Hosting and Testing with DevShop & Behat. Jon Pugh Intermediate 112: Exove Decoupling Drupal modules into PHP libraries bojanz Advanced 111: Adyax
09/23/2015 - 17:00-09/23/2015 - 18:00 Session Speaker(s) Experience level Room What's your type? Andreu Balius Intermediate 113: Amazee Labs Perfecting Drupal IA: Harmonious Menus, Paths, and Breadcrumbs Jody Lynn Intermediate 118-119: Platform.sh
09/24/2015 - 10:45-09/24/2015 - 11:45 Session Speaker(s) Experience level Room Making Drupal a better out-of-the-box product: Report on usability testing results and how we can make 8.1.x+ shine webchick, Bojhan, LewisNyman Beginner 122-123: Interoute Building the Front End with Angular.js ceng Intermediate 112: Exove
09/24/2015 - 13:00-09/24/2015 - 14:00 Session Speaker(s) Experience level Room CIBox - full stack open source Continuous Integration flow for Drupal/Symfony teams podarok, ygerasimov Intermediate 113: Amazee Labs
09/24/2015 - 14:15-09/24/2015 - 15:15 Session Speaker(s) Experience level Room The wonderland of HTTP in PHP dawehner Intermediate 115 Introducing Probo.CI tizzo Intermediate 118-119: Platform.sh
"The advantages of variables in Drupal 7 is they're all loaded into memory. The disadvantages of variables in Drupal 7 is they're all loaded into memory".
With this, Károly Négyesi ('chx'), opened his Storing Data with Drupal 8 workshop at Drupalaton to a standing room only crowd - half whom chuckled knowingly, with the rest following shortly after once they'd had a little time to think about this technical juxtaposition.
It is this pull no punches attitude which made chx's workshop, for me at least, the highlight of the event - I like to know what is wrong, why it is wrong, and what we can or are doing to fix it. It was different when I'd asked the Hungarian, now living in Vancouver, to keynote our local DrupalCamp Brighton held back in January. In a departure from his normal techie talks, chx delivered a highly enjoyable and enlightening session talking about the profession of programming and how computer game music was the best type of music to listen to when coding. Here at Drupalaton though, we were back to the nitty and gritty of Drupal's internals.
Chx proceeded to give an excellent overview of the different subsystems of Drupal and how they'd changed from version 7 to 8. Drupal 8 brings together a lot of pieces which were fragmented in Drupal 7 - for example Drupal's Entity API where most of the functionality existed in a contributed module. By bringing it all together into core Drupal and providing APIs it improves maintainability through common knowledge, translation, access, performance and testing. He went on to cover the improved data stores in Drupal 8, for example the state API to store information such as when maintenance updates were last run using cron, a private tempstore for functionality like autosave data and the new quick edit functionality, and a shared tempstore for things like views.
After an intense hour and a half and a short break chx for a moment thought he'd lost half the audience but most soon filtered back in once their brains had a little more time for the coffee to take effect! The workshop continued with much information about how to use these new APIs, and how all configuration was now in YAML files then loaded into the database at runtime. In previous versions of Drupal, many settings were stored in the database and work-arounds such as using the Features module were used to extract settings. These approaches had varying results - as someone coming from an Enteprise Java world where storing settings in files is the norm I for one am very excited about this as it provides far more easier development, deployment and versioning. Features still exist in Drupal 8, but for their original purpose - to create exportable features of functionality.Contributing to Drupal can be tiring!
After the workshop I made my way to the only air-conditioned room for what felt like miles around and managed to catch this picture of chx resting - with lots of talk recently about 'Headless Drupal' I thought the angle was quite funny.
I'd gone there to do some more work on Drupal 8 Rules - the fifth most popular module for Drupal which enables people to create functionality through the user interface, for example to send an email when someone adds a comment, or to apply a certain tax rate for a certain product in a certain country.
Although I'd previously worked on a few core issues for Drupal 8 like splitting up the 'password strength' and 'password matches' code and cleaning up some unused variables, I'd not really found an area I could focus on, but then I attended Drupalaton last year where there was a whole day of Rules, with a morning workshop bringing people up to speed on Rules in Drupal 8 and an afternoon spent focusing on how you could get involved and contribute.
For me, the workshop format is what makes Drupalaton so special - most other DrupalCamps have half-to-an-hour long sessions where you get an overview of something but don't really get time to delve in deep. I wanted to learn Drupal 8, and helping Rules out where I could to me seemed like a pretty good way of learning it. Since then I've helped update a few Rules Actions, Conditions, and Events to Drupal 8 and although I haven't done half as much as I've wanted to, it feels great to be learning lots and hopefully helping progress things a little bit.Cruise Party
After spending the afternoon learning more about exporting, importing, and deploying configuration management in Fabian Bircher's workshop (slides and a great blog post from Fabian here), it was time for the yearly Drupalaton Cruise Party.
The cruise party is an excellent chance to chill out, see a little more of Central Europe's largest lake, talk Drupal, and enjoy a most wonderful sunset!Behold Behat!
The next morning, after I'd managed to complete 30 lengths of the swimming pool and a 20km cycle for the second day in a row (yes, I know, shocker, but the Sun makes me a different person than I am in the dreary rainy grey UK!) it was workshop time again - this morning's being 'From User Story to Behat Test' with Pieter Frenssen.
I'm almost as excited about using Behat as I am about Drupal 8 - after many years of discussions about how functionality X worked, or whether feature X and function Y was included in the original quote, this way of defining requirements provides an excellent interface all project stakeholders can be a part of, with a solid technical backing enabling tests to be performed against sets of Plain English user stories.
The workshop was to go through setting up Behat with Drupal 8 which was great as I'd spent some time recently getting it set up but lacked in-depth understanding of the setup which Pieter's workshop helped enormously with so now I'll be using it on all my projects. There's plenty of info online about Behat so I won't go into more details here.Grill Party
The afternoon was spent discussing using Drupal as a prototyping tool with Kristof Van Tomme László Csécsy and finding out about Pretotyping. This is of particular interest to me as I continue my work on abilit.es - a topic for another blog I think!
In the evening the lovely Drupalaton organising team arranged a Grill Party - this didn't happen last year but was great as was right next to the hotel and means we weren't dispersed across many different places.
As well as great food a few people had been working on some lyrics and provided lots of entertainment with a fab Drupalaton song!So long Drupalaton, till next year! Sunday was fairly quiet, no sessions were on but the sprint room was open so I interspersed some rules work with some cycling. After a few days of the hotel's all-inclusive menu I wasn't expecting to lose any weight, but certainly enjoyed getting the metabolism up and running again nicely! In 36 degrees cycling was not easy but certainly fun and I'm glad I took my Brompton on its first trip abroad - I'd been wanting an opportunity to test out the Vincita Sightseer bag and it did not disappoint. I look forward to taking my bike to more places around the world - you definitely get to see a lot more of a place than just by foot and with the bag going into normal hold it doesn't cost any extra than normal baggage. Monday finally came round and it was time to make the journy back to the UK via Budapest. The train to Budapest is always an experience - it stops *everywhere* and takes three hours to go just over a hundred miles, has no air conditioning, and wouldn't let me on without buying a 'boading pass' even though I had a ticket already. Luckily it was not much and I had a small amount of local currency to cover it otherwise I would've been stuck! Felt great to cycle out of the hotel down to the train station the pack the bike up in its own bag (it fits on the back rack when riding) and I can't wait till I can do it all again, perhaps DrupalCon Barcelona, although I'm not a huge fan of cycling in cities & DrupalCon is quite intense so perhaps not, we'll see! A big thank you to all those who had something to do with this lovely event, from organising to speaking, sponsoring, and of course attending, am already looking forward to next year's holiday, erm - I mean, Drupalaton! tags: DrupalatonDrupal 8Drupal PlanetPlanet Drupal
This is a continuation of my series of posts on using Drupal as a data platform. In this post I show that you can create charts on data external to Drupal. I picked three modules to illustrate my point from a longer list of available contributed Drupal charting modules. There are two documentation pages that give more detailed information on Drupal charting modules. Modules related to Charts and Comparison of Charting modules.
This is a follow up to the previous post Database Transactions in Drupal where we saw in detail how little attention transaction management has had (and still has) in Drupal.
In this article we will see:More articles...
- Making namespaced callbacks work in Drupal 7 (without hacking core and with bound parameters)
- Fixing Drupal site locks during menu rebuild
- Installing Drupal on Windows and SQL Server
- Bypassing Form Validations and Required Fields in Drupal: the BFV module.
- Benchmarking Drupal 7 on PHP 7-dev
- Using Heatmaps to boost conversions: Heatmap.me Drupal integration
- Git shell on Windows reports “sh.exe has stopped working (APPCRASH)”
- Deploying Drupal Like a Pro - Part 1: File Structure
- Setting up Code Syntax Higlighting with Drupal
- Build GIT on Windows from Sources
Episode 101 of Jen Simmons’ wonderful podcast The Web Ahead featured content strategist Eileen Webb. Good stuff from start to finish, you should really check it out. There was one particular point that resonated with me, when they talked about user experience of people whose job is to add content to the website.
Not to get super philosophical, but capitalism isn’t really keen on improving working conditions for employees. It’s not super excited about spending money and energy on making things nicer for the people who you are paying.
― Eileen Webb on The Web Ahead
Drupal comes with a lot of out-of-the-box functionality that can help make the content editing experience less confusing,...
The success of a project depends on a good development team. How to build and maintain such a good team?
As, a software developer for many years, I believed a good dev team is one of the pillars for a successful business. Here, I want to discuss how to build a dream developer team. Building a high productive, super innovative and proactive team is like cooking a meal. It needs a good ingredient, right source, and good timing in each step of cooking.
A good developer has a good academy score in math. Software developing needs the strongest logic thinking and self-validation skill. Building a software project like taking a mathematics test. The higher score in the test means fewer bugs in the code. A person who is capable of getting full scores on math tests is likely to build a project with least bugs. Finding right persons is the first step toward a great team.
A good academy score will not automatically make a good developer. Building software projects are team workings. Developing software is very detail oriented. We may not be able to avoid nitpicking on something. Soft skill is important too. A good developer is willing to learn, easy to collaborate and detail oriented. A good developer will always focus on the matters but never escalate matters to a personal level. A good developer can accept criticism and change for a greater good of the team.
After we have gathered a group of talented developers, it is time to "cook". Every person can be in different states. Software developers can be in the peak productivity state or the bottom of the productivity. An encouraging and rewarding environment with a strong leadership is the key to motivating developers to reach the peak of their productivity. Reward developers with self-fulfillment and let them achieve something with their work. A leading developer with an extraordinary fellowship will help it a lot.
We might ignore the physical environment. Nice, clean, quiet offices help developers focusing on their job. Some start-up companies put a lot of effort to finding talents but did not let them work comfortably. Sometimes, offices are crowded and stuffy. What they can do is just stop looking for a smarter developer and put a little bit more effort to improve the current working condition. In such a company, even the best developer is not able to concentrate on his job. Software developing is a mind activity. The brain requires a lot of blood circulation with plenty of oxygen and energy. The importance of clean, quiet, natural and toxic-free environment will never be overestimated. A healthy environment is a basic requirement for a strong software product.
The next one is an a study oriented and encouraging setting; A company has a respectful culture and a group of open minded developers. It is where developers are very closely collaborating with each other. Developers are not afraid to make a mistake and willing to share their latest trick and newly mastered programming tactics.