Drupal News

A couple of issues

  • We are running Drupal 8.4.0, whenever we install a theme or a new module, after carefully checking to make sure it is 8.x compatible, we consistently get "An unexpected error has occurred." We have been able to run the update.php file to get rid of that error. Most of the time.

    With our update from 8.3 to 8.4 now we are getting a "page not found" error after attempting to run the update.php. The URL shows <our site>/start?id=8&op=start.

    Has anyone seen this or do they have any suggestions?


    submitted by /u/Adenn76
    [link] [comments]

    6 days 27 min ago

myDropWizard.com: It's OK to build new sites on Drupal 7

  • In about a month, it'll be 2 years since Drupal 8.0.0 was released. Drupal 8 has come a long way since then, especially with Drupal 8.4.0 released two weeks ago, which is the most feature-packed release yet.

    Drupal 8 is the future of Drupal. It's awesome.

    However, looking at all the blogs and articles and podcasts in the Drupalsphere, we're sending a message that you should only build new sites on Drupal 8.

    The common wisdom is that starting a new project on Drupal 7 is dumb idea.

    While I'm sure there's lots of people who are OK with that or even think that's the right message...

    I strongly believe that we are hurting the Drupal project by sending that message.

    Read more to find out why!

    6 days 1 hour ago

Drupal core announcements: Coding Standards Change Proposals 10/17

Elevated Third: Elevated 3 Takeaways: Drupal 8

  • Elevated 3 Takeaways: Drupal 8 Elevated 3 Takeaways: Drupal 8 Nelson Harris Tue, 10/17/2017 - 10:35

    In this edition of 3 Takeaways, our Business Development Strategist, Nelson Harris, reviews Drupal 8 and how the latest improvements help get more out of the box, leverage mobile, and upgrade smoothly.



    Hi, I’m Nelson Harris, Business Development Strategist at Elevated Third. A question I get a lot from people is “what’s new and interesting about Drupal 8, and why might I upgrade.” There are a lot of reasons why you might want to upgrade to Drupal 8 but I’m just going to list three of them.

    Takeaways #1: First, you get more out of the box.

    There are a lot of useful modules in Drupal 8 core that have been built in. Things like views, multilingual, a WYSIWYG editor, and more types of fields. This means you can spend less time configuring and installing modules, and more time working on your site.

    Takeaway #2: Second of all, mobile is in it’s DNA.

    Built-in themes are all responsive and adapt well to different screen sizes. Tables will scale, and the new admin toolbar is really good on mobile devices. Chances are, you’re probably watching this video on the screen of your mobile device right now, so you can imagine why mobile might be important.

    Takeaway #3: Finally, it’s built to be more future proof.

    Where an upgrade from 7 to 8 or 6 to 7 requires scraping your codebase and starting all over from scratch, Drupal 8 is designed to go from 8 to 9 and 9 to 10 more seamlessly and more like an update patch as opposed to starting over. An investment in Drupal 8 really means that you're investing in your website because it's going to be easier to upgrade in the future.

    6 days 6 hours ago

Sendgrid Integration Module, Rules, and non-attaching attachments fix for drupal 7.

  • I was having trouble finding ANY information on this at all on the web, so I thought I'd post it here in case someone else has the same problem in the future (or for future me to forget what I did and wander onto later)..

    Background: I have a rule setup that, whenever a certain webform is submitted, drupal will grab the info, use PDFTK to fill out a PDF with that info, attach the newly created PDF to an email and send it out. We're using Sendgrid with sendgrid integration module to send our emails out, and we wanted to use the API instead of doing it the SMTP way (for various reasons..). We're also using Mail System and Mime Mail modules.

    The problem: When sending the e-mail triggered by rules via sendgrid integration API, no attachment was getting .. attached.. The email would come through fine, but without the pdf attached. (Attachment was working fine using the sendgrid SMTP method, but again, we needed to use the API method).

    The reason: Turns out that sendgrid integration module uses the format $message['attachments'] when looping through files to attach, and drupal was sending it to the function as $message['params']['attachments'].

    Solution: I went into the Mail System module's admin interface (admin/config/system/mailsystem) and created a new class, using MimeMailSystem as the format() method, and SendGridMailSystem as the mail() method. This will generate a file called MimeMailSystem__SendGridMailSystem.mail.inc in your sites/default/files/mailsystem folder. Overwrite the public function mail(array $message){} function with the following:

    public function mail(array $message) { if(!empty($message['params']['attachments'])){ $message['attachments'] = $message['params']['attachments']; foreach($message['attachments'] as $key => $value){ if(!empty($value['filepath'])){ $message['attachments'][$key] = $value['filepath']; } } } return $this->mailClass->mail($message); }

    Then, back on the Mail System admin page, set Side-wide default class to 'SendGridMailSystem', set Mime Mail module class to 'MimeMailSystem__SendGridMailSystem', and set SendGrid Integration module class to 'SendGridMailSystem'. Test it out and voila, attachments are attached.

    This is the best way I could figure out how to fix the issue without editing the SendGrid Integration module directly via patch or otherwise.

    QUICK SIDE NOTE - When creating the new class (which generates the .inc file in your files directory), if your files directory is a sym link, it's going to crash out your drupal install. We had this problem testing on Pantheon. The solution is to patch MailSystem to not use drupal_real_path(). Patch information located here

    submitted by /u/PerInception
    [link] [comments]

    6 days 7 hours ago

It's Triumphant Tuesday! Post your recent Drupal wins and launches

Drupal Modules: The One Percent: Drupal Modules: The One Percent —Timelogin (video tutorial)

  • Drupal Modules: The One Percent —Timelogin (video tutorial) NonProfit Tue, 10/17/2017 - 08:47 Episode 40

    Here is where we seek to bring awareness to Drupal modules running on less than 1% of reporting sites. Today we'll look at Timelogin, a module which restricts users, based on role, from logging in during certain times of the day.

    6 days 8 hours ago

Appnovation Technologies: Appnovator Spotlight: Paulo Gomes

  • Appnovator Spotlight: Paulo Gomes Who are you? What's your story? My name is Paulo Gomes, I am from Portugal and moved to the UK with my wife in 2016 to join Appnovation crew. I am an tech and web enthusiast since the 90's (so not too old and not too young), I graduated in Computers and Management in 2002, after that worked in many places and companies, as freelancer, trainer and t...

    6 days 12 hours ago

Dropsolid: Load testing Drupal with Blazemeter and JMeter

  • 17 Oct Load testing Drupal with Blazemeter and JMeter Niels A Tech

    When going live with a big project, it is all about reassuring the client that the project will be able to handle all those excited visitors. To achieve that state of zen, it is paramount that you do a load test. The benefits of load tests go beyond peace of mind, however. For example, it enables you to spot issues that only happen during high load or let’s you spot bottlenecks in the infrastructure setup. The added bonus is that you can bask in the glory of your high-performance code - on the condition the test doesn’t fail, of course.

    Need help with your load and performance testing?
    Contact us 


    When doing a load test it is important to do the following steps:

    • Analyse existing data
    • Prepare tests
    • Set up tools
    • Run the tests
    • Analyse the results


    Analyse existing data

    If you are in luck, you will already  have historic data available to use from Google Analytics. If this isn’t the case, you’ll have to get in touch with your client and ask a few to-the-point questions to help you estimate all the important metrics that I’ll be covering in this post.


    A couple of tips I can give if you lack the historic data:

    • Ask if the client has a mailing (digital or old-school) list and how many people are on it
    • If you have made comparable sites in the past, look at their Google Analytics data
    • Ask the client how they are going to announce their new website
    • When you are working on an estimate, it is always better to add an extra 15% to it. Better safe than sorry!

    The first thing you need to do, is set a reference frame. Pick a date range that has low activity as well as the highest activity you can find. Then start putting that data into a spreadsheet, as pictured below:

    You can download an example copy of the file here


    The most important metrics we are going to calculate are:

    • Peak concurrent user (Hourly sessions x Average sessions Duration / 3600)
    • Peak page views per second


    The values you need to find or estimate are:

    • Peak daily page views
    • Peak hourly page views
    • Total page view for period
    • Peak hourly sessions
    • Total amount of sessions
    • Average session duration in seconds

    As you can see, we mainly focus on the peak activity, because you test with the worst-case scenario in mind - which is, funnily enough, usually the best-case scenario for your client.

    Before we start preparing our test, it is also handy to check which pages receive the most traffic. This benefits the validity of your test scenario.


    Prepare the tests

    For our tests we are going to start out with Apache JMeter, which you can grab here.

    With JMeter you can test many different applications/server/protocol types, but we’re going to use it to make a whole lot of HTTP requests.

    Make sure you have the required Java library and go boot up the ApacheJMeter.jar file.


    Adding and configuring a Thread Group

    Start by adding a Thread Group to your test plan by right clicking your Test plan and selecting Add > Threads (Users) > Thread Group


    Eventually you will need to fill in the number of (concurrent) users and ramp-up period based on your analysis, but for now keep it low for debugging your test.


    Adding and configuring User-Defined Variables

    Then right click the thread group to add User Defined Variables (Add > Config Element > User Defined Variables).

    Add two variables named url and protocol and assign them a value.

    Using these user-defined variables makes it easy to choose another environment to test on. It avoids the painstaking and error-prone work of finding all references and changing them manually.

    You can use these variables in input fields in your test by doing this: ${url} or ${protocol}


    Adding and configuring HTTP config elements

     Next up, you need to add the following HTTP config elements to your thread group:

    • HTTP Request Defaults
    • HTTP Header Manager
    • HTTP Cookie Manager

    On the first one, you use your variables to fill in the protocol and the server name.

    On the second one, you can set default headers for each one of your requests. See the screenshot below for what I’ve put in default.

    For the third one, you only select cookie policy: standard.


    A simple page request sampler

    Right-click your test again and add the HTTP request sampler (Add > Sampler > HTTP Request).

    Here we are going to call the home page. The only things you need to set here are:

    • Method: GET
    • Path: /

    We don’t fill in the protocol or server name because this is already covered by our HTTP Request Defaults.


    Posting the contact form

    In this one we are going to submit the contact form (which is located at www.example.com/contact), so add another HTTP Request like we did before. Now only fill in the following values:

    • Method: POST
    • Path: /contact
    • Follow redirects: True
    • Use KeepAlive: True

    In order for Drupal to accept the submit, we need to add some parameters to our post, like this:

    The important ones here are form_build_id and form_id. You can manually get the form id because it always stays the same. The form build ID can vary, so we need to extract this from the page. We’ll do this using the CSS/JQuery Extractor (right-click your HTTP Request sampler: Add > Post Processors > CSS/JQuery Extractor)

    Configure it like the screenshot below:

    It will now get that form_build_id from the page and put into a variable the sampler can use.$


    Posting some Ajax on the form

    Imagine our contact form has some Ajax functionality and we also want to test this. The way we go about it is identical to posting the regular form like we did before. The only difference is the post parameters, the path and an extra HTTP Header Manager.

    You should set the path in your sampler to: /system/ajax

    Then right click your sampler to add your new HTTP Header Manager (Add > Config Element > HTTP Header Manager). Configure it like shown in the screenshot:

      Saving the results of your test

    Now that we’ve configured samplers, we need to add some listeners. You can add these listeners everywhere, but in our example we’ve added it to the test in a whole.


    We’ll add three listeners:

    • View Results in Table:
      • Show every request in a table format
      • Handy for getting some metrics like latency and connect time
    • Simple Data Writer:
      • Writes test data to a file
      • Handy for debugging when using Blazemeter (check out this link)
      • Just load the file into the View Results Tree
    • View Results Tree:
      • It shows you the actual response and request.
      • Uses a lot of resources (so only good for debugging)


    There is a lot more you can do with JMeter. You can read all about it here.

    Test-run the test

    Now that we’ve configured our test it is time to try it out. So make sure not to put too much concurrent users in there. Just run the test by pressing the green ‘Play’ icon.

    If you get errors, debug them using the feedback you got from your listeners.

    As this wise man once said: "Improvise. Adapt. Overcome."

    After you’ve validated your test, it’s always handy to turn up the concurrent users until your local site breaks. It’ll give you a quick idea of where a possible bottleneck could be.

    Just a small warning: doing that load test on your local machine (running the test and the webserver) will take up a lot of resources and can give you skewed results.

    You can download an example here.


    Set up tools Load testing with Blazemeter

    When you have a project that will have a lot of concurrent users, your computer is most likely not able to handle doing all those calls and that is why it is good to test from a distributed setup like Blazemeter does.


    You can have multiple computers running the same test with only a part of the concurrent users or you can pay for a service like Blazemeter.


    The downside of using multiple computers is that they still use the same corporate WiFi or ethernet, blocking yourself possibly to the lowest common denominator, which is most likely unknown and could cause trouble that might skew your test. On top of that you will also have to aggregate all those results yourself, costing you precious time.


    For us the mayor benefits of Blazemeter are the following:

    • Simulate a massive amount of concurrent users with little hassle
    • Persistence of test results and comparison between tests
    • Executive report to deliver to a technical savvy client
    • Sandbox mode tests that don’t count against your monthly testing quota


    Adding your JMeter test in Blazemeter is very easy and straightforward. Just click ‘Create Test’ in the menu and select JMeter Test.

    Upload the file and you can start to configure your test to reflect your test scenario from the analysis chapter. We suggest to choose to ‘Originate a load’ from a service that is closest to your target population.

    Before you run your test, it is important to have set up your monitoring of the environment you want to test.


    Monitoring performance

    At Dropsolid, we like to use New Relic to monitor performance of our environments but you could also use open source tools like Munin.

    The most important factors in your decision of monitoring tool should be:

    • Persistence of monitoring data
    • Detail of monitoring data
    • Ease of use

    If you are using New Relic, we recommend to install both APM and Server. The added value of having APM is that you can quickly get an overview of possible bottlenecks in PHP and MySQL.


    Run the test

    Now that everything is set up, it is important to have an environment that is a perfect copy of your production environment. That way you can easily optimize your environment without having to wait for a good moment to restart your server.

    Run your test, sit back and relax.


    Analyse the results

    If everything has gone according to plan, you should now have reports from both Blazemeter and New Relic.

    Blazemeter report of a test of 854 concurrent usersNew Relic monitoring during the same test

    If your server was able to handle the peak amount of users, then your job is done and you can inform the client that they can rest assured that it won’t go down.

    If your server couldn’t handle it, it is time to compare the results from Blazemeter and New Relic to find out where your bottleneck is.

    Common issues are the following:

    • Not the right memory allocation between parts of the stack.
    • Misconfiguration of your stack. For example, MySQL has multiple example configuration files for different scenarios
    • Not using extra performance enhancing services like varnish, memcache, redis,...
    • Horrible code

    If the issue is horrible code, then use tools like xhprof or blackfire.io to profile your code.

    Need expert help with your performance tests? Just get in touch!

    Contact us for performance testing 

    Final note

    As Colin Powell once said: "There are no secrets to success. It is the result of preparation, hard work and learning from failure." That is exactly what we did here: we prepared our test thoroughly, we tested our script multiple times and adapted when it failed.

    6 days 12 hours ago

Drupal 7 vs. 8 performance loss

  • I have not seen discussion on the topic of raw throughput for Drupal 8. It runs a lot more code than Drupal 7 for each request, so it naturally takes more time. There is done older articles on the topic, but nothing as of late. E.g. https://drupal.sh/drupal-7-drupal-8-benchmarks

    All the performance gains I've seen come from increased caching, rather than improvements in raw performance. This is increasingly an issue if you would like to use Drupal in headless scenarios with minimal resources.

    PHP itself has not not made big strides in optimization since 7.0, and PHP as an app server has not picked up as expected in 2015 with PHP-PM, etc.

    Especially with AWS and other cloud pricing scales, and Drupal 7 was not lauded for perf either... Has anyone noted any negative impacts of upgrading to Drupal 8 in terms of non-cached performance?

    submitted by /u/velmu3k
    [link] [comments]

    1 week 2 hours ago