You are here

Drupal Planet

Subscribe to Drupal Planet feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 1 hour 1 min ago

Drupal.org blog: What’s new on Drupal.org - October 2019

4 hours 27 min ago

   

Select members of the Drupal Association team have just returned from a wonderful DrupalCon Amsterdam. The revival of the European DrupalCon was a tremendous success, and we want to thank all of the volunteers and sponsors who made it possible. 

The content at the conference was great as well. This year the core initiative leads provided a comprehensive update, followed by the traditional #Driesnote the next day, which laid out the vision for Drupal 9's key initiatives moving forward. The DA also shared an update from the Drupal Association board, held a community town hall, and provided our bi-annual update from the engineering team. 

While DrupalCon was action-packed, we also moved forward a lot of other initiatives on the community's behalf in October. 

Project News Reminder: Drupal 8.8.0 is coming soon! 

Drupal 8.8.0-beta1 was released in early November, to be followed by the full release in early December. A variety of great features are landing in version 8.8.0, including improved Composer support in core, an updated Media Library, and updates to JSON:API. This is likely to be the last minor release before the simultaneous release of Drupal 8.9.0 and Drupal 9.0.0 next June.  

If you want to help ensure a smooth release, we invite you to join the Drupal Minor Release beta testing program.

Time to get ready for Drupal 9

The time is now to get ready for Drupal 9. At DrupalCon Amsterdam the core initiative team put out the call for the community at large to get ready. 

If you are a site owner, the best way you can get ready is to make sure you're up to date on the latest version of Drupal 8. From there, it'll be an easy upgrade to 9. 

If you maintain a community module, or your own custom modules, you may have some work to do.  Many contributed or even custom modules only need a one-line change to be ready for Drupal 9. Check yours using: the upgrade status module, or the Drupal Check command line tool.

Drupal.org Update Automatic Updates Initiative needs your help!

For the last year we've been working together with the European Commission to bring automatic updates to Drupal. The first phase of this work covers updates for Drupal Core only, and only in non-Composer scenarios, but even so it should be able to protect many Drupal 8 and especially Drupal 7 site owners. 

The module is ready for testing now. Your feedback is welcome to help us make this first phase stable for production use by the community. 

You can also help by supporting Phase 2 of this initiative, which will include more advanced features like support for Composer-based sites, database updates, and a robust roll-back capability. We're looking for sponsors for this next round of work now. 

Forming a Contribution Recognition Committee

The Drupal Association's contribution credit system is an industry first in open source, and so we want to take great care on each step on this new journey. 

During the conference we also announced the formation of a Contribution Recognition Committee to govern the contribution credit algorithm which weights the order of the Drupal services marketplace on drupal.org. 

We are now seeking applications from community members who would like to sit on the committee. 

When will we enable GitLab merge requests?

When we migrated Drupal.org's git repositories to GitLab, it was the first step on the road to modernizing and improving the project's collaboration tools. The most significant step in that journey will be enabling merge requests, and we know it's a feature that the community has been waiting for. 

So what's the hold up? 

There are a few factors that have held us back from enabling the feature sooner. First, we were waiting for the GitLab team to add support for Git object de-duplication. Beta support for this feature was added in GitLab version 12.0, and then enabled by default beginning with the release of GitLab version 12.1.

While waiting for these features, the Drupal Association engineering team focused on other major commitments: moving forward the Automatic Updates initiative, in partnership with the European commission, co-leading the Composer Initiative to improve support in Drupal core, and preparing Drupal.org to support the release of Drupal 9. 

While these other initiatives have overtaken much of our internal capacity, we're hoping to get back to the merge request feature very soon, and we're just as excited to release the feature as you are to begin using it! 

———

As always, we’d like to say thanks to all the volunteers who work with us, and to the Drupal Association Supporters, who make it possible for us to work on these projects. In particular, we want to thank: 

  • Zyxware - Renewing Signature Supporting Partner
  • EPAM - Renewing Premium Supporting Partner
  • Datadog - Premium Technology Supporter
  • KWALL - Renewing Classic Supporting Partner
  • ANNAI - Renewing Classic Supporting Partner
  • SymSoft - Renewing Classic Supporting Partner
  • Forum One - Renewing Classic Supporting Partner
  • Catalyst IT - Renewing Classic Supporting Partner
  • Old Moon Digital - Renewing Classic Supporting Partner
  • Authorize.Net - *NEW* Classic Technology Supporter
  • SiteGround - Renewing Classic Hosting Supporter

If you would like to support our work as an individual or an organization, consider becoming a member of the Drupal Association

Follow us on Twitter for regular updates: @drupal_org, @drupal_infra

Categories: Drupal

Evolving Web: Drupal North: Growth of the Drupal Ecosystem in Canada

Mon, 11/11/2019 - 04:21

There’s never been a better time to be a Drupal user in Canada.

Since I started using Drupal in 2008, I’ve seen anecdotal evidence that Drupal is popular in Canada. Since 2006, and probably earlier, there have been active users groups in Toronto, Vancouver, and Montreal, that organize regular conferences and meetups. These local groups are key to the Drupal community’s culture of open source and knowledge sharing. So I wasn’t surprised to learn that Canada is fourth in the world in terms of active users on Drupal.org (behind the US, Great Britain, and India).

Now, with the trend towards using Drupal for enterprise-level projects, the Canadian federal government, which has been using Drupal for years across a myriad of departments, is moving towards Drupal as the go-to platform for building digital experiences. It’s already being used by almost every government department you can think of in some capacity, but with the government's new Open First philosophy, Drupal is poised to become the default choice.

On November 21, Dries Buytaert (the founder of Drupal) will be in Ottawa talking about digital transformation for government. And at the 2019 DrupalCamp Ottawa this year (a sold-out event) I encountered a wave of government agencies eager to adopt Drupal for building the next wave of digital services and information portals for citizens and public servants. The ability to standardize on a platform that is secure, multilingual, and accessible, and also flexible enough to meet the needs of a whole range of applications and audiences is what makes Drupal so appealing. 

Recently, I’ve also seen growing momentum behind Drupal in the Quebec. Sites for Tourism Quebec, Viarail, and the Aéroports de Montréal are built with Drupal. And beyond public organizations, iconic Quebec brands like Agropur and Videotron are using Drupal for their large-scale web projects.

At Drupal North earlier this year (the largest Drupal event in Canada), I co-hosted a higher education summit that was attended by web managers and developers from some of the largest educational institutions in our country: the University of Toronto, McGill, Université Laval, and the University of Waterloo to name but a few. Many of these organizations also contribute to the Drupal project, sharing code, best practices, and techniques for scaling Drupal.

Even at non-Drupal web conferences, Drupal is a common topic of conversation. When I presented at year's #PSEWEB in Saskatoon (the Canadian version of HighEdWeb Conference), where I heard that the University of Calgary is continuing to re-platform their sites onto Drupal 8. 

Pantheon sponsored Drupal North this year, announcing that they would be expanding their hosting services to Canada, joining Acquia in catering to organizations that are mandated to host on Canadian soil or who want hosting close to home.

I'm looking forward to seeing the market for Drupal expand further in Canada. I'd love to hear your thoughts on how we can grow the community!

One thing we do at Evolving Web to keep Drupal growing is by providing Drupal training, including free community trainings online and at Drupal Camps, and more in-depth trainings. We have trainings coming up in Ottawa and Vancouver. And training on-demand in Toronto, Montreal, Quebec City, Calgary, Winnipeg, Halifax, Victoria, and your corner of Canada. Just give us a shout if we should do a training in your town.

+ more awesome articles by Evolving Web
Categories: Drupal

DrupalCon News: Program Committee Support

Fri, 11/08/2019 - 21:42

The program committee talks about how you can share that unique voice and perspective of yours that we want to hear!

Categories: Drupal

OpenSense Labs: Best of Drupal 8 Modules for Social Login

Fri, 11/08/2019 - 18:50
Best of Drupal 8 Modules for Social Login Jayati Fri, 11/08/2019 - 20:20

From gated content to event enrollments, social logins and easy registration are the go-to for many sites now. The website captures data and permissions from your social accounts and gives you access to the content. There are modules primarily dedicated to integrate social accounts and run the process. 

Drupal offers many modules for seamless integration of social logins for your website. 

Let’s skim through the list and their features! 

Check out this list of modules for social login in Drupal 8 and choose the one that suits you best:

OneAll Social Login

Offering 35+ social networks to login from, the OneAll Social Login is a significant module that can benefit you. It is fully compliant with European (GDPR) and U.S. data protection laws. The module monitors changes constantly and automatically updates APIs for a smooth run of the logins. The simplified process helps increase the registration rate, too.

Social Auth

A commonly used module, Social Auth is part of the Social API. It possesses its own content entity and stores all data in the database. With this Drupal 8 module, visitors can register on the website via 30 social networks including Slack, Reddit, Uber, and more.   

Auth0 Single Sign On

It provides a login form powered by Auth0. With implementing authentification for platforms like GitHub and Twitter, Auth0 Single Sign On is another top module in the list. 

Social Auth Google

Primarily for Google account, the Social Auth Google module can help you register and log in with any social site. It performs the authentication on your behalf and gives seamless access.  

Hybrid Auth Social Login

With the aid of the HybridAuth library, this module integrates Drupal and allows the login and registrations for the visitors on sites like Facebook, Twitter, Windows Live, Instagram, AOL, and much more. The HybridAuth Social Login doesn’t depend on external services or load any external CSS or JS files for the authentification process. 

However, it relies on a third-party open source PHP library, HybridAuth, developed and supported on GitHub. 

uLogin (advanced version)

A selective range of forms is available in this module for the social logins to be integrated with your Drupal site. Written in compliance with Drupal coding standards, uLogin has several widgets with default settings that are configurable through UI. The module gives you options to remove username and password fields from the user profile edit form.

Varbase Social Single Sign-On

Varbase module is built using Social API and adds single sign-on using your social networking services. It is supported by the Drupal 8 version and even if installed with the Minimal or Standard profile.

Social Auth Facebook

It is a direct module for Facebook and allows users to register/login to the Drupal site via a Facebook account. The scope of the website’s request is wider and based on the authentication with Facebook services. The module also compares the user id or email address facilitated by Facebook. It automatically accepts the login if it is a returning user to the site.

Social Auth Twitter 

Similar to the above two, this is also exclusive to Twitter. It allows the user to register and login to your Drupal site and is based on Social Auth and Social API. 

The Social Auth Twitter module lets you compare the user id or email address once Twitter brings you back to the site.

Social Auth LinkedIn 

This module allows websites to request any scopes and users to register/login to your Drupal site with the LinkedIn account. The Social Auth LinkedIn module lets you compare the user id or email address once LinkedIn brings you back to the site. The ‘LinkedIn’ button lets you initiate the login in the social auth block.

Conclusion

These modules will definitely support the login process of your website and placidly run the integration. With each module having its own significance one can only decide for themselves which suits them the best.

We at OpenSense Labs have a pioneering experience in site building with Drupal 8 and its modules. For the best of services contact us at hello@opensenselabs.com

Also, connect with us on our social media channels: FacebookLinkedIn, and Twitter for more such insights. 

blog banner blog image Social Media Platforms Drupal 8 Drupal module Drupal Modules Drupal 8 Module Blog Type Articles Is it a good read ? On
Categories: Drupal

Drupal core announcements: Drupal 7 roadmap and release schedule published, plus PHP 7.3 compatibility!

Fri, 11/08/2019 - 18:43

The Drupal 7 maintainers have published a new D7 roadmap and release schedule:

https://www.drupal.org/core/drupal7-roadmap-release-schedule

There is also a new proposed D7 contributor / maintainer workflow issue:

https://www.drupal.org/project/drupal/issues/3093258

Finally, we're pleased to announce that the 7.x branch's core tests now pass in PHP 7.3!

Feedback is welcome, and thank you very much to all of the many D7 contributors!

Categories: Drupal

Mediacurrent: 5 Reasons Why You Should Consider a GraphQL Server

Fri, 11/08/2019 - 17:24
What is GraphQL?

If you are a frontend web developer you have probably heard of GraphQL or maybe you have even used it, but what is it? GraphQL is a query language for APIs that allows you to write queries that define the data you receive. No more emailing the backend team to update an endpoint for your application. The client developer defines the data returned in the request.

What is a GraphQL Server/API?

A GraphQL server is a server-side implementation of the GraphQL spec. In other words, a GraphQL server exposes your data as a GraphQL API that your client applications can query for data. These clients could be a single page application, a CMS like Drupal, a mobile app, or almost anything. For example, say you have a MySQL database and you want to expose the content to a React application. You could create a GraphQL server that will allow our React application to query the database indirectly through the GraphQL server.

Why would you consider a GraphQL API? 1. You need an API for your applications

At Mediacurrent, we have been building decoupled static web sites using GatsbyJS. But sometimes we also need some components with dynamic data. You need an API for that and our front-end team was already using GraphQL in Gatsby. Or maybe you might develop a mobile app and need a reliable and fast way to get data from your legacy database. You can use GraphQL to expose only the data you need for your new app but at the same time give your client app developers the ability to control what data they get back from the API.

2. You need data normalization

For our purposes as developers data normalization is simply the process of structuring our data to remove redundancy and create relationships between our data. Data normalization is something database designers think about but developers and software architects should consider as well.

One of the biggest mistakes I’ve seen in my years building web applications is the pattern of including too much business logic in application components. These days, it is not unusual to require data from multiple applications, public REST APIs as well as databases. There is often duplication across these systems and the relationships are rarely clear to the development team. Creating components that require data from multiple systems can be a challenging task. Not only do you have to make multiple queries to retrieve the data, but you also need to combine it in your component. It’s a good pattern to normalize the data outside of your components so that your client application’s components can be as simple and easy to maintain as possible. This is an area where GraphQL shines. You define your data’s types and the relationships between your data in a schema. This is what allows your client applications to query data from multiple data sources in a single request.

3. You love your client application developers

A well-built GraphQL server will avoid these issues that are common with REST APIs.

  • Over-fetching - receiving more data than you need.
  • Under-fetching - not receiving all the data you need.
  • Dependent requests - requiring a series of requests to get the data you need.
  • Multiple round trips - needing to wait for multiple requests to resolve before you can continue.


Over-fetching

In a perfect would we would only fetch the data we need. If you have ever worked with a REST API you will likely know what I mean here. Your client application developers may only need a user’s name but it is likely that when they request the name using the REST endpoint they will get much more data back from the API. GraphQL allows the client to specify the data returned in the request. This means a smaller payload delivered over the web which will only help your app be more performant.

Under-fetching, dependent requests, and multiple round trips

Another scenario is under-fetching. If you need a user’s name and the last three projects they were active on, you probably need to make two HTTP requests to your REST API. With GraphQL relationships, you can get this data back in a single request. No more callbacks and waiting on multiple endpoints to resolve. Get all your data in one request. Now you are avoiding multiple requests, dependent requests, and multiple round trips to get the data for your app’s components.


GraphQL single request to multiple data sources.

Self documenting

The type based schema that GraphQL provides creates the structure to build powerful tools like Graphiql, an in-browser IDE for exploring GraphQL.

This schema also allows for what I would call a self documenting API. GraphQL playground is an example of the power of the GraphQL schema. It takes this schema and creates documentation as well as an IDE like Graphiql. When you update your schema, your documentation is automatically updated as well as the IDE. That’s a huge win!


You can try out a demo of the GraphQL Playground on graphqlbin.com.

4. GraphQL can replace your legacy REST API

It can be challenging to maintain versions of a REST API. Requirements change. You need to add new fields or maybe you want to delete fields from your database. Due to the requirements for backward compatibility your API has to continue supporting these old requirements. Maybe you have an old Android mobile app that relies on your REST endpoints. Maybe you have a Salesforce integration that you don’t have time to update. Most organizations can’t update all their applications at once so you can’t just turn off your old REST API. A GraphQL server can act as a middleware between your old REST API and your new applications. Then as you update your other client apps that use the REST API’s you can update them to work with your new GraphQL API. Once all of your clients are no longer using the REST endpoints you can replace the REST API fully with the GraphQL API.

5. You’re tired of maintaining old versions of your REST API

GraphQL has the @deprecated annotation that you can add to your schema to let clients know that a field should no longer be used. This is much easier to maintain than multiple versions of a REST API.

Which server should you use?

Check out GraphQL.org’s list of servers. There are projects in C# / .NET, Clojure, Elixir, Erlang, Go, Groovy, Java, JavaScript, PHP, Python, Scala, and even Ruby. My choice is the Apollo Server project. It has great documentation and provides a self documenting API for your team that is enjoyable to use. If you use Drupal there is the Graphql module that adds a GraphQL API to your site.

I hope I’ve sparked your interest in GraphQL and building a GraphQL server API. At Mediacurrent, we have seen how powerful this tool can be for solving complex application and data problems and we’d love to talk with you about it. Hit us up in the comments.

Categories: Drupal

Agiledrop.com Blog: Our blog posts from October 2019

Fri, 11/08/2019 - 14:14

Each month, we do a roundup of all the blog posts we wrote in the previous month. So, no need to worry if you missed some of our posts from October - here’s an overview of all of them!

READ MORE
Categories: Drupal

heykarthikwithu: Drupal JSON:API GET, POST, PATCH and DELETE Samples

Fri, 11/08/2019 - 13:44
Drupal JSON:API GET, POST, PATCH and DELETE Samples

The API that the JSON:API module makes available is centered on Drupal's entity types and bundles. Every bundle receives its own, unique URL path, which all follow a shared pattern.

karthikkumardk Friday, 08 November 2019 - 15:15:10 IST
Categories: Drupal

Consensus Enterprises: Lando and Drumkit for Drupal 8 Localdev

Fri, 11/08/2019 - 03:06
Over the last 2 or 3 years, the Drupal community has been converging around a solid set of Docker-based workflows to manage local development environments, and there are a number of worthy tools that make life easier. My personal favourite is Lando, not only because of the Star Wars geekery, but also because it makes easy things easy and hard things possible (a lot like Drupal). I appreciate that a “standard” Lando config file is only a few lines long, but that it’s relatively easy to configure and customize a much more complex setup by simply adding the appropriate lines to the config.
Categories: Drupal

Drupal blog: State of Drupal presentation (October 2019)

Fri, 11/08/2019 - 02:24

This blog has been re-posted and edited with permission from Dries Buytaert's blog.

DrupalCon Amsterdam Driesnote presentation

Last week, many Drupalists came together for Drupalcon Amsterdam.

As a matter of tradition, I presented my State of Drupal keynote. You can watch a recording of my keynote (starting at 20:44 minutes), or download a copy of my slides (149 MB).

Drupal 8 innovation update

I kicked off my keynote with an update on Drupal 8. Drupal 8.8 is expected to ship on December 4th, and will come with many exciting improvements.

Drupal 8.7 shipped with a Media Library to allow editors to reuse images, videos and other media assets. In Drupal 8.8, Media Library has been marked as stable, and features a way to easily embed media assets using a WYSIWYG text editor.

I'm even more proud to say that Drupal has never looked better, nor been more accessible. I showed our progress on Claro, a new administration UI for Drupal. Once Claro is stable, Drupal will look more modern and appealing out-of-the-box.

The Composer Initiative has also made significant progress. Drupal 8.8 will be the first Drupal release with proper, official support for Composer out-of-the-box. Composer helps solve the problem of Drupal being difficult to install and update. With Composer, developers can update Drupal in one step, as Composer will take care of updating all the dependencies (e.g. third party code).

What is better than one-step updates? Zero-step updates. We also showed progress on the Automated Updates Initiative.

Finally, Drupal 8.8 marks significant progress with our API-first Initiative, with several new improvements to JSON:API support in the contributed space, including an interactive query builder called JSON:API Explorer. This work solidifies Drupal's leadership position as a leading headless or decoupled solution.

Drupal 9 will be the easiest major update

Next, I gave an update on Drupal 9, as we're just eight months from the target release date. We have been working hard to make Drupal 9 the easiest major update in the last decade. In my keynote at 42:25, I showed how to upgrade your site to Drupal 9.0.0's development release.

Drupal 9 product strategy

I am proud of all the progress we made on Drupal 8. Nevertheless, it's also time to start thinking about our strategic priorities for Drupal 9. With that in mind, I proposed four strategic tracks for Drupal 9 (and three initial initiatives):

Strategic track 1: reduce cost and effort

Users want site development to be low-cost and zero-maintenance. As a result, we'll need to continue to focus on initiatives such as automated updates, configuration management, and more.

Strategic track 2: prioritizing the beginner experience

As we saw in a survey Acqua's UX team conducted, most people have a relatively poor initial impression of Drupal, though if they stick with Drupal long enough, their impression of Drupal grows significantly over time. This unlike any of its competitors, whose impression decreases as experience is gained. Drupal 9 should focus on attracting new users, and decreasing beginners' barriers to entry so they can fall in love with Drupal much sooner.

Beginners struggle with Drupal while experts love Drupal.

Drupal's sentiment curve goes in the opposite direction of WordPress', AEM's and Sitecore's. This presents both a big challenge and opportunity for Drupal.

We also officially launched the first initiative on this track; a new front-end theme for Drupal called "Olivero". This new default theme will give new users a much better first impression of Drupal, as well as reflect the modern backend that Drupal sports under the hood.

Strategic track 3: drive the Open Web

As you may know, 1 out of 40 websites run on Drupal. With that comes a responsibility to help drive the future of the Open Web. By 2022-2025, 4 billion new people will join the internet. We want all people to have access to the open web, and as a result should focus on accessibility, inclusiveness, security, privacy, and interoperability.

Strategic track 4: be the best structured data engine

We've already seen the beginnings of a content explosion, and will experience 300 billion new devices coming online by 2030. By continuing to make Drupal a better and better content repository with a flexible API, we'll be ready for a future with more content, more integrations, more devices, and more channels.

Over the next six months, we'll be opening up these proposed tracks to the community for discussion, and introducing surveys to define the 10 inaugural initiatives for Drupal 9. So far the feedback at DrupalCon Amsterdam has been very positive, but I'm looking forward to much more feedback!

Growing sponsored contributions

In a previous blog post, Balancing Makers and Takers to scale and sustain Open Source, I covered a number of topics related to organizational contribution. Around 1:19:44, my keynote goes into more details, including interviews with several prominent business owners and corporate contributors in the Drupal community.

You can find the different interview snippet belows:

  • Baddy Sonja Breidert, co-founder of 1xINTERNET, on why it is important to help convert Takers become Makers.
  • Tiffany Farriss, CEO of Palantir, on what it would take for her organization to contribute substantially more to Drupal.
  • Mike Lamb, Vice President of Global Digital Platforms at Pfizer, announcing that we are establishing the Contribution Recognition Committee to govern and improve Drupal's contribution credit system.
Thank you

Thank you to everyone who attended Drupalcon Amsterdam and contributed to the event's success. I'm always amazed by the vibrant community that makes Drupal so unique. I'm proud to showcase the impressive work of contributors in my presentations, and congratulate all of the hardworking people that are crucial to building Drupal 8 and 9 behind the scenes. I'm excited to continue to celebrate our work and friendships at future events.

Thanks to the 641 individuals who worked on Drupal 8.8 so far.

Thanks to the 243 different individuals who contributed to Drupal 8.8 to date.

Categories: Drupal

Jeff Geerling's Blog: Sponsor my Open Source development work on GitHub

Fri, 11/08/2019 - 00:40

tl;dr: You can now sponsor my open source development work via GitHub Sponsors.

GitHub Sponsors is the latest foray into building a more sustainable future for open source software development. There have been many attempts before, a few of which I tried (Gratipay, Patreon, etc.), but most of them never reached a critical mass, and at most you'd end up getting maybe $20-50/month out of the platform. Another prolific open source contributor I've long followed wrote about the topic of open source support and developer burnout in a post this year, Webform, Drupal, and Open Source...Where are we going?.

Categories: Drupal

Texas Creative: Composer & Drupal for Beginners

Thu, 11/07/2019 - 20:00

Learn the ins-and-outs of installing and managing Drupal 8 using Composer, the PHP dependency manager. Composer reads a configuration file for a project, then determines all of the underlying software that the project needs in order to work, along with what versions of those applications are compatible with all parts of the project.

Read More
Categories: Drupal

Drudesk: Beautiful websites with new main Drupal 9's Olivero theme

Thu, 11/07/2019 - 16:57

All beautiful websites have one thing in common — a good theme. It should be not only beautiful but mobile responsive, accessible, and ready to support modern website functionality.

This is exactly about Olivero — the future main front-end theme for Drupal 9. And this future is just around the corner because Drupal 9 is coming! And it is bringing the era of beautiful websites.

Categories: Drupal

TomThorp.me Blog: How to build beautiful CERN websites

Thu, 11/07/2019 - 16:02
How to build beautiful CERN websites using Drupal 8
Categories: Drupal

TomThorp.me Blog: Nasty PHP7 bug exploit in the wild

Thu, 11/07/2019 - 15:26
New PHP7 bug CVE-2019-11043 can allow even non-technical attackers to take over servers.
Categories: Drupal

Lullabot: Custom Layout Options in Drupal 8

Wed, 11/06/2019 - 21:52

Like most CMS products that provide structured content modeling tools, Drupal excels at building template-driven pages with consistent layouts. A blog post might use one template and a staff bio another, but as long as the basic shape of the page is consistent, Drupal's traditional content modeling and page composition tools are usually enough. When it comes time to build special content, though—departmental portal pages, landing pages for ephemeral marketing campaigns, editorial curated topic hubs, and so on—Drupal's combination of templates and structured content can fall short.

Categories: Drupal

InternetDevels: Shopping cart usability & Commerce Cart Flyout Drupal module

Wed, 11/06/2019 - 20:22

Shopping cart is a vital place in your online store where the “moment of truth” often happens — the customer either proceeds to checkout or abandons the purchase.

The situation can be changed in favor of option 1 if you increase shopping cart usability. Among nice Drupal 8 shopping cart modules, we would like to discuss one today. Its name is the Commerce Cart Flyout module in Drupal 8, so let’s see what it does in the usability arena.

Read more
Categories: Drupal

Centarro: Commerce 2.15 adds invoicing, VAT number handling, and Drupal 9 readiness

Wed, 11/06/2019 - 19:42

We had a great time at DrupalCon Amsterdam last week introducing the European Drupal communtiy to our new brand, our near term product roadmap, and our recently launched support offering. It's always encouraging to hear from the many active individual and agency contributors in Europe, and the broad interest we received in Centarro Support validated our approach for providing fast, professional support in a dedicated channel.

Categories: Drupal

Joachim's blog: Debugging and Logging AJAX requests tests in Docksal

Wed, 11/06/2019 - 18:30

The hardest thing I find with tests is understanding errors. Every time I think I've got debugging output sorted, I find a new layer where it doesn't work, I've got nothing, and I'm in the dark with something that's crashing and I don't know why.

The first layer is simple: errors in your test code itself. For example, make a typo in your tests/src/Functional/MyTest.php and PHPUnit crashes and you see the error in the terminal.

But when it's site code that's crashing, you're dealing with a system that is being driven by code, and therefore, you can't see it. And that's a major obstacle to figuring out a problem.

The HTML output that Drupal's Functional and Functional Javascript tests produce is a huge help: every time your test code makes a request to the test site, an HTML file is written to the test files directory. If your site crashes when your test makes a request, you'll see the error and the backtrace there.

However, there's no such output when in a Functional Javascript test you cause an AJAX request. And while you can create a screenshot of what the page looks like after the request, our another HTML file of the page (see https://www.drupal.org/project/drupal/issues/3090498 for instructions how; the issue is about how to make that automatic but I have no idea how that might be possible), you can't see the actual error, because AJAX requests that fail just sit there doing nothing. There's nothing useful to see in the browser.

So we need to see logs. When a real site has an AJAX crash, with a human being-controlled web browser making the request, you can go and look in the logs. With a test site, the log table is zapped when the test is completed.

Fortunately, Drupal 8's pluggable logging means there are other ways of getting hold of them, more permanent ways.

I first tried log_stdout module. This outputs log errors to STDOUT. If you're running on Docksal, as I am, you have an extra layer to get though to see that. You can monitor the cli container with fin logs -f cli, and with that module add a | ag WATCHDOG to filter.

However, I wasn't seeing backtrace in this output, and I gave up figuring out why.

So I tried filelog module instead, which as the name implies, writes log to a simple text file. This needs a little bit more work, as by default it writes to 'public://logs'. This means that each run of the test gets its own log file, which is perhaps what you want, but for my own uses I wanted a single log file I could tail -f in a terminal window and have continual monitoring.

A quick bit of config setting in the test's setUp() does the trick:

$this->config('filelog.settings') ->set('location', '/var/www/docroot/sites/simpletest/logs') ->save();

And I think that's me at last sorted.

Tags: debuggingtestsdrupal planet
Categories: Drupal

ComputerMinds.co.uk: Making product images consistent with image styles

Wed, 11/06/2019 - 18:22

We’ve recently given the dimplex.co.uk site a new face lift and stumbled across an interesting problem during development when it came to implementing the new product carousel on their product pages, more specifically, the handling of the images themselves.

The design brief stipulated that the transparent studio style product images required a light grey background behind it, giving the impression of a product floating nicely in the middle of a light grey surrounding.

We had 2 problems here:

1. A lot of the studio style product images didn’t have sufficient transparent space around themselves and we ended up with unsightly results; images would be touching the edges of its container and weren’t sitting in the middle as intended. We needed to cater for these types of images.

2. We have a mix of studio and lifestyle shots. We couldn't just apply the same image style to both types of image; we would have to come up with something magic/clever to distinguish a studio shot from a lifestyle shot and then apply an image style accordingly.

Given that we are ComputerMinds (we massively care about our clients and we love a challenge) and knowing that the client would have to manually go back, edit and re-upload thousands of images, we decided if would be cool if we could come up with a code solution for them. Below is a brief outline as to how we achieved a code solution to a design/content problem. Enjoy!

Our concept was pretty clear; for images that had at least 1 - and no more than 3 - edges that contained transparent pixels, apply a Drupal image style with a custom effect that would “pad” out the image. The idea was, if an image has 4 transparent edges, the image had sufficient space around it. If it had no transparent edges we knew this was a lifestyle product shot, i.e a radiator in a lounge.

I started looking at the possibilities of detecting transparent pixels with PHP and came across a handy function from the PHP GD image library called imagecolorat(). Using this function and some hexadecimal converter madness (please don't ask me to explain!), we can detect what type of pixel we are looking at given a set of coordinates.

// The result of $transparency will be an integer between 0 and 127 // 127 is transparent, 0 is opaque/solid. $rgba = imagecolorat($image_resource, $x, $y); $transparency = ($rgba >> 24) & 0x7F;

Now we needed to run this function for every pixel along on all four edges. So, first things first, grab the image width and height and subtract 1 from the result. Subtracting 1 ensures you won’t hit a PHP notice about being “out of bounds” - we’re not playing a round of golf here :). Next, we need to sort out our coordinate ranges for us to loop over:

// Top side X = 0 Y = $image_width // Bottom side X = $image_height Y = $image_width // Left side X = $image_height Y = 0 // Right side X = $image_width Y = $image_height

For each permutation of coordinates (x=0, y=750, x=1, y=750, x=2, y=750 etc) , we simply check each pixel result from imagecolorat() and save the result to an array for us to check later on. Once we have detected a transparent and a non-transparent pixel (remembering to check our magic number 127), we then break out because we have all the information we need from this particular edge.

After you’ve completed this process for all four sides, we then do a simple check to see we have a mix of transparent and non transparent pixel edges. If we do, then we pass the image along to our custom image style for processing.

Our custom Drupal image style uses the “define canvas” image processor from the contrib module imagecache actions. We define our own image style effect but use imagecache_actions’ “define canvas” processor to transform our image. This is where we add X amount of pixels to increase the “padding” around the image.

In order to create a custom Drupal image style, we would need to implement hook_image_effect_info() and place any effect code into the "effect callback". See below for an example.

/** * Implements hook_image_effect_info(). */ function MY_MODULE_image_effect_info() { $effects = array(); // Remember to replace MY_MODULE with the name of your module (in lower case). $effects['MY_MODULE_transparent_padding'] = array( 'label' => t('Transparent padding'), 'help' => t('Applies padding if an image has a mix of transparent and solid pixels around the edges of an image.'), 'effect callback' => 'MY_MODULE_transparent_padding_effect_callback', 'form callback' => 'MY_MODULE_transparent_padding_form', 'summary theme' => 'transparent_padding_summary', ); return $effects; } /** * Callback for MY_MODULE_transparent_padding image effect. */ function MY_MODULE_transparent_padding_effect_callback(stdClass $image, array $data) { if ($image->info['mime_type'] == 'image/png') { $image_height = ($image->info['height'] - 1); $image_width = ($image->info['width'] - 1); $image_resource = $image->resource; // Do the coordinate magic and determine transparent and non transparent pixels // Build up $data array (this will contain background colour and amount of pixels - // to pad out the image. // Use imagecache_actions custom effect "define canvas" and pass in your $data array. $success = image_toolkit_invoke('definecanvas', $image, array($data)); return $success }

Below is the result of our custom image style effect settings form as defined above in hook_image_effect_info via "form callback". (The form was taken directly from imagecache_actions' definecanvas effect where I made a couple of edits - so credit goes to them)

And the result is shown below: a before and after. Much better! Furthermore, we’ve saved the client from having to manually edit thousands of images and then manually re-upload them. Win win!

 

 

Categories: Drupal

Pages