Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 7 min 55 sec ago

Joachim's blog: Regenerating plugin dependency injection with Module Builder

21 February 2018 - 1:52pm

Dependency injection is a pattern that adds a lot of boilerplate code, but Drupal Code Builder makes it easy to add injected services to plugins, forms, and service classes.

Now that the Drupal 8 version of Module Builder (the Drupal front-end to the Drupal Code Builder library) uses an autocomplete for service names in the edit form, adding injected services is even easier, and any of the hundreds of services in your site’s codebase (443 on my local sandbox Drupal 8 site!) can be injected.

I often used this when I want to add a service to an existing plugin: re-generate the code, and copy-paste the new code I need.

This is an area in which Module Builder now outshines its Drush counterpart, because unlike the Drush front end for Drupal Code Builder, which generates code with input parameters every time, Module Builder lets you save your settings for the generated module (as a config entity).

So you can return to the plugin you generated to start with, add an extra service to it, and generate the code again. You can copy and paste, or have Module Builder write the file and then use git to revert custom code it’s removed. (The ability to insert generated code into existing files is on my list of desirable features, but is realistically a long way off, as it would be rather complex, a require the addition of a code parsing library.)

But why stop at generating code for your own modules? I recently filed an issue on Search API, suggesting that its plugins could do with tweaking to follow the standard core pattern of a static factory method and constructor, rather than rely on setters for injection. It’s not a complex change, but a lot of code churn. Then it occurred to me: Drupal Code Builder can generate that boilerplate code: simply create a module in Module Builder called ‘search_api’, and then add a plugin with the name of one that is already in Search API, and then set its injected services to the services the real plugin needs.

Drupal Code Builder already knows how to build a Search API plugin: its code analysis detects the right plugin base class and annotation to use, and also any parameters that the constructor method should pass up to the base class.

So it’s pretty quick to copy the plugin name and service names from Search API’s plugin class to the form in Module Builder, and then save and generate the code, and then copy the generated factory methods back to Search API to make a patch.

I’m now rather glad I decided to use config entities for generated entities. Originally, I did that just because it was a quick and convenient way to get storage for serialized data (and since then I discovered in other work that map fields are broken in D8 so I’m very glad I didn’t try to make then content entities!). But the ability to save the generating settings for a module, and then return to it to add to them has proved very useful.

Tags: drupal code buildermodule builder
Categories: Drupal

myDropWizard.com: Drupal core security update for SA-CORE-2018-001 (including Drupal 6!)

21 February 2018 - 10:37am

Today, there is a Critical security release for Drupal core to fix multiple vulnerabilities. You can learn more in the security advisory:

Drupal core - Critical - Multiple Vulnerabilities - SA-CORE-2018-001

What makes this release special, is that some of these issues also affect Drupal 6! So, we're also making a Drupal 6 Long-Term Support (D6LTS) release of Drupal core.

Drupal 6 core security update

As you may know, Drupal 6 has reached End-of-Life (EOL) which means the Drupal Security Team is no longer doing Security Advisories or working on security patches for Drupal 6 core or contrib modules - but the Drupal 6 LTS vendors are and we're one of them!

The following vulnerabilities mentioned in the security advisory affect Drupal 6:

  • JavaScript cross-site scripting prevention is incomplete - Critical

  • jQuery vulnerability with untrusted domains - Moderately Critical

  • External link injection on 404 pages when linking to the current page - Less Critical

Here you can download the Drupal 6 patch to fix, or a full release ZIP or TAR.GZ.

If you have a Drupal 6 site, we recommend you update immediately! We have already deployed the patch for all of our Drupal 6 Long-Term Support clients. :-)

If you'd like all your Drupal 6 modules to receive security updates and have the fixes deployed the same day they're released, please check out our D6LTS plans.

Note: if you use the myDropWizard module (totally free!), you'll be alerted to these and any future security updates, and will be able to use drush to install them (even though they won't necessarily have a release on Drupal.org).

Categories: Drupal

Drupal Console: Drupal Console 1.6.1

21 February 2018 - 8:19am

Drupal Console 1.6.1 is out. The latest release contains bug fixes. Also no longer required dependencies removed from the project and development dependencies added as suggested packages.

Categories: Drupal

Acro Media: Drupal Commerce 2: How to Add a Payment Gateway

21 February 2018 - 8:10am

Drupal Commerce 2 comes with a payment gateway system that allows for all kinds of payment methods to be added into your ecommerce site. Many of the standards you're used to seeing, Authorize.net, PayPal, Stripe, etc., are already good to go. On top of that, Commerce 2 has a fantastic API making it easy for developers to connect new gateway plugins.

What if you also want to allow your customers to pick up their order in-store? Or maybe you want to accept email money transfers or some other manual payment method. No worries! Drupal Commerce 2 is so adaptive that setting up these methods is also easy to do.

In this Acro Media Tech Talk video, we user our Urban Hipster Commerce 2 demo site to show how you can add, and manage, your payment gateways. 

Its important to note that this video was recorded before the official 2.0 release of Drupal Commerce, and so you may see a few differences between this video and the current release. The documentation is also evolving over time.

Urban Hipster Commerce 2 Demo site

This video was created using the Urban Hipster Commerce 2 demo site. We've built this site to show the adaptability of the Drupal 8, Commerce 2 platform. Most of what you see is out-of-the-box functionality combined with expert configuration and theming.

More from Acro Media Drupal modules in this demo

Categories: Drupal

Mediacurrent: Mediacurrent to Present 6 Sessions at Drupalcon Nashville

21 February 2018 - 7:24am

Selected sessions for Drupalcon Nashville have just been announced! Mediacurrrent will be presenting five sessions and hosting a training workshop. 

From exploring new horizons in decoupled Drupal to fresh perspectives on improving editorial UX and achieving GDPR compliance, check out what the Mediacurrent team has in store for Drupalcon 2018:
 

Categories: Drupal

Mediacurrent: Mediacurrent to Present 5 Sessions at Drupalcon Nashville

21 February 2018 - 7:24am

Selected sessions for Drupalcon Nashville have just been announced! Mediacurrrent will be presenting five sessions and hosting a training workshop. 

From exploring new horizons in decoupled Drupal to fresh perspectives on improving editorial UX and achieving GDPR compliance, check out what the Mediacurrent team has in store for Drupalcon 2018:
 

Categories: Drupal

Sooper Drupal Themes: Drupal 8 Release Candidate For All Products and Demos!

21 February 2018 - 5:20am
Drupal 8 SooperThemes: After nearly a year of work we're almost there! It has taken us twice as long as we originally estimated. Drupal 8 itself has had its delays so maybe there is no surprise that updating our complex Drupal 7 theming and drag & drop platform with 15 unique theme designs and 1000+ demo content items is delayed. We now have a feature-complete stable version or Release Candidate for all our products ready for you to test! Besides that, we just moved to a new server that has all the infrastructure upgrades in place for our Drupal 8 launch.Migrating 15 Demos With 1000+ Content Items

The past 6 weeks have been spent mostly on migrating all demo content and designs to the Drupal 8 framework. This work mostly consisted of copying, manually testing, and re-exporting pages, images, menu links, configuration etc. The glorious result of this painstaking work can be seen here: https://demo.sooperthemes.com/

Can I start using this on production?

Not just yet, we recommend to hold off for the stable release before taking this puppy to production! However, the RC1 will be easy to upgrade to the upcoming stable release so I suggest you can start building your Drupal 8 project using our theme or builder, report any issues on our support forum, and launch it when we launch our stable release.

Having spent the last year just coding away at the Drupal 8 product line I now have to quickly put on my documentation and marketing hat and start churning out content and documentation updates for the website. We will spend the coming 2-3 weeks to update our website and then immediately put out a stable release for all products.

What's Next?

Of course we won't get bored after completing this monumental update. To SooperThemes the D8 release is a major milestone that brings us to the next chapter in the life cycle of our business. After the Drupal 8 release we will start paying a lot more attention to documentation, customer support, and marketing. We're excited to now have a product that exceeds everyone's expectations both in capability and now compatibility. We're going to keep developing our products, and also work on making ourselves more known inside and outside the Drupal community. 

Get Testing!

If you're already on board with Sooperthemes.com you now have access to all Drupal 8 downloads in the Downloads page. If you want to help testing, or if you just want to get started with your Drupal 8 project head on over!

Open Source Contributions

Now that we have our core business covered with our Drupal 8 products, we're going to continue making live easier for the Drupal community at large with our awesome free theme and module contributions. We want to make the free version of our theme the best Drupal 8 and 7 theme on Drupal.org. Of course our premium theme will retain some features that will remain exclusive to our patrons but even if we slice the feature count in half we probably still have the most loaded, flexible theme on drupal.org. Since our free Glazed theme is also the default theme for our Glazed CMS Drupal distribution, we also intend on having the best looking distribution our on Drupal.org. Stay tuned for updates! 

Categories: Drupal

Agiledrop.com Blog: AGILEDROP: Top 6 Drupal websites released in 2017

20 February 2018 - 5:07pm
There have been many sites build in Drupal in the year 2017, so we have made a list of some example worth highlighting. Check them out.    First one on the list is a website of National Athletic Trainers' Association made by Skvare. You can read a case study here. NATA is the professional membership association for certified athletic trainers and others who support the athletic training profession.   We continue our list with a website of the University of Minnesota. The site was built by Palantir. They’ve written a case study, check it out here. The University of Minnesota has almost 70… READ MORE
Categories: Drupal

Drupal.org blog: What's new on Drupal.org? - January 2018

20 February 2018 - 1:34pm

Read our Roadmap to understand how this work falls into priorities set by the Drupal Association with direction and collaboration from the Board and community.

In January the Drupal Association kicked off the new year with our Winter Staff Retreat, where the whole organization came together to review the past 6 months and lay out our strategy for the new year. In addition to taking a big picture look at our upcoming priorities, we also made some great improvements this past month.

Before we dive into those, we'd like to welcome Dhanya Girish to the Drupal Association team. Her time has been generously sponsored by Zyxware and she joins us as a skilled engineer. Please welcome Dhanya!

Drupal.org Updates Celebrating Drupal's 17th Birthday

To celebrate the 17th birthday of Drupal, we've embedded a wonderful video on the home page, celebrating some of the incredible things that have been built with Drupal. Drupal has grown from being a dorm-room experiment to being the driver for some of the most powerful digital experiences on the web. We can't wait to see what the next 17 years bring.

Proposed new initiatives for collaboration with Core

The Drupal Association engineering team meets monthly with the Drupal Core committers to align our goals and ensure that we're on the same page about what the project needs moving forward. At the beginning of this year we outlined some new proposed initiatives that, in collaboration with Core, we believe could be a tremendous value to the project.

None of these initiatives can be accomplished quickly, nor can they be moved forward without the collaboration of key contributors and the core committers, but we strongly believe they will be important next steps for the future of Drupal.

Refresh of the Hosting Listings program

A major focus in January was the refresh of our hosting listings program. The new hosting listings now display all providers on the primary view, with a series of filters to help users find exactly the right hosting partner. This update also brings a much needed visual refresh to the listings. New filters and search facets will help end-users find the hosting partner that is right for their needs, industry, and budget, and will enable users to identify and support those platforms that support the project.

Promoting industry solutions in the marketplace

Over the last year, we've been focused on pushing a message about crafting the perfect solution for particular industries with Drupal. We link to this information off of the front page, but we've also added a contextual block in the sidebar that will appear whenever users filter the marketplace by the relevant industry.

These efforts are an ongoing part of better serving the various personas who come to Drupal.org. Look forward to hearing about even more changes on this front as we approach DrupalCon Nashville in April.

In-context issue tag explanations

One of the cornerstones of Drupal.org contribution and issue management is our issue tagging system. However, it's been difficult in the past to understand what each tag is used for, especially for tags that are carefully monitored and curated by project maintainers or the core committer team. We've enhanced the tagging system by providing in-context hover-states that describe what tags are used for.

Infrastructure Updates Implemented PerimeterX for increased protection from DDOS, crawlers, badbots etc.

Would you believe that Drupal.org is the target of a bad crawler or outright DDOS attack at least once every two months? The team does an incredible job reducing the impact on end users of Drupal.org, but to make that job easier, we've partnered with PerimeterX for bad bot protection integrated with our CDN. PerimeterX integrates closely with Fastly, our CDN, and so can provide intelligent logic and protection at the edge.

We're starting off using this system simply for greater introspection into the nature of traffic patterns and the attacks of bad actors. We're gradually enabling the protection as we tune the system for Drupal.org's unique needs. We want to thank PerimeterX for supporting the project, and for helping to make Drupal.org a better place for our community.

DrupalCI: Support for yarn-based core tests

We've added a yarn build-step plugin to DrupalCI, allowing us to support new testing types, including nightwatch javascript tests in core and contrib. We want to provide a special thanks to community contributors who helped: justafish, dawhener, and mile23.

———

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:

  • PerimeterX - *NEW* Signature Technology Supporting Partner
  • publicplan - *NEW* Premium Supporting Partner
  • WebEnertia - *NEW* Premium Supporting Partner
  • Electric Citizen - *NEW* Classic Supporting Partner
  • Factorial - *NEW* Classic Supporting Partner
  • One Shoe - Renewing Classic Supporting Partner
  • DRUD - 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

2bits: Drupal Performance and Scalability With Excessive I/O Load Or Memory Exhausion

20 February 2018 - 7:50am

On many occasions, we see web site performance suffereing due to misconfiguration or oversight of system resources. Here is an example where RAM and Disk I/O severely impacted web site performance, and how we fixed them.

A recent project for a client who had bad site performance uncovered issues within the application itself, i.e. how the Drupal site was put together. However, overcoming those issues was not enough to achieve the required scalability with several hundred logged in users on the site at the same time.

First, regarding memory, the site configured too many PHP-FPM processes, and that left no room in memory for the filesystem buffers and cache, which help a lot with disk I/O load.

Here is a partial display from when we were monitoring the server before we fixed it:

As you can see, the buffers + cache + free memory all amount to less than 1 GB of total RAM, while the used RAM is over 7GB.

used buffers cache free 7112M 8892k 746M 119M 7087M 9204k 738M 151M 7081M 9256k 770M 125M 7076M 4436k 768M 136M 7087M 4556k 760M 133M

We did calculations on how much RAM is really needed by watching the main components on the server:

In this case the calculation was:

Memcache + MySQL + (Apache2 X number of instances) + (PHP-FPM X number of instances)

And then adjusting the PHP-FPM number of processes down to a reasonable number, for a total application RAM of no more than 70% of the total.

The result is as follows. As you can see, used memory is now 1.8GB instead of 7GB. Free memory will slowly be used by cache and buffers making I/O operations much faster.

used buffers cache free 1858M 50.9M 1793M 4283M 1880M 51.2M 1795M 4258M 1840M 52.1M 1815M 4278M 1813M 52.4M 1815M 4304M

Another issue with the server, partially caused by by the above lack of cache and buffers, but also by forgotten settings, caused a severe bottleneck in the Disk I/O performance. The disk was so tied up that everything had to wait. I/O Wait was 30%, as seen in top and htop. This is very very high, and should usually be no more than 1 or 2% maximum.

We also observed excessive disk reads and writes, as follows:

disk read disk write i/o read i/o write 5199k 1269k 196 59.9 1731k 1045k 80 50.7 7013k 1106k 286 55.2 23M 1168k 607 58.4 9121k 1369k 358 59.7

Upon investigating, we found that the rules_debug_log setting was on. The site had 130 enabled rules and the syslog module was enabled. We found a file under /var/log/ with over a GB per day and growing. This writing of rules debugging for every page load tied up the disk when a few hundred users were on the site.

After disabling the rules debug log settings, wait for I/O went down to 1.3%! A significant improvement.

Here is the disk I/O figures after the fix.

disk read disk write i/o read i/o write 192k 429k 10.1 27.7 292k 334k 16.0 26.3 2336k 429k 83.6 30.7 85k 742k 4.53 30.8 Now, the site has response times of 1 second or less instead of the 3-4 seconds. Contents: Tags: 
Categories: Drupal

Appnovation Technologies: Customizing displays and templates in D8

20 February 2018 - 12:00am
Customizing displays and templates in D8 Drupal is really good at allowing the user (developer) manipulate its data. It’s very common to override templates for nodes and views in D7, but in Drupal 8, it’s been made even easier to override templates at every level.  I found I was writing a lot less pre-processors on a D8 project versus D7.  On a recent project, and I’m sure the ma...
Categories: Drupal

Matt Glaman: Open Source: Community and Opportunity

19 February 2018 - 7:35pm
Open Source: Community and Opportunity mglaman Mon, 02/19/2018 - 21:35

DrupalCamp London is coming around the corner! If you have the chance to go, I highly recommend it. The organizers put on a top-notch event. Last year I had the privilege of giving my first keynote at the conference. I firmly believe that open source is a creator of opportunity. There is no such thing as free software. In open source, we donate our time to provide software that has no monetary cost. This lowers the barrier to entry by removing a layer economic limitations.

Categories: Drupal

frobiovox.com: Why DrupalCon

19 February 2018 - 4:00pm
Collaboration and Contribution at DrupalCon Drupal is the most flexible general purpose Content Management System on the market today—Open Source or not. Using Drupal enables us to provide a cost effective and flexible platform for our clients, while contributing to Drupal allows us to ensure it remains the most flexible general purpose Content Management System. As contributing to Drupal is the job of the Drupal Community, it’s essential that Drupal...
Categories: Drupal

DrupalEasy: Learning Made Easier Leveraging Drupal's Social Construct

19 February 2018 - 3:18pm
When I walk along with two others, from at least one I will be able to learn.   – Confucius

Drupal development as a career is usually also a commitment to constant learning through ongoing professional development.  Whether you make it a point to read blog posts or watch screencasts, sign up for some type of live-instructor training, or partake in co-working and meet-ups, on-going learning is a critical piece to being a professional Drupal  developer. Years ago, when DrupalEasy was presenting our Drupal Career Technical Education program exclusively in-person (now Drupal Career Online), the lab-portion (where we met in a less formal way than classroom sessions) became so popular with students, that we decided to continue to host them after graduation for anyone who had taken the class.

Six years later, these "office hours"are still going strong, now online and attended by people weekly from all over the country. It’s amazing to see the developers who first learned how to spell Drupal years ago in our riverside classroom in Cocoa, Florida; now the veterans assisting and connecting with those from recent sessions. People from former sessions, even those who attend at different times, also support each other beyond the labs, which has all contributed to the development of, what we think, is a pretty cool DrupalEasy Learning Community.

Weekly on Thursday afternoons U.S. Eastern Time, you can find DrupalEasy’s Mike Anello leading Go-To-Meeting ofice hours sessions, which are open to anyone who is enrolled in, or has taken any long-form DrupalEasy training courses. It’s a loose session devoted to helping anyone overcome issues, figure out how to approach something, share insights on particular modules and also talk Drupal. Learning experts call this collaborative learning, and it has even more advantages than we realized, which explains why it is so popular and seemingly effective as both an initial learning strategy and ongoing professional development tool. Everyone learns (Even Mike).

The Cornell University Center for Teaching Innovation explains that  “Collaborative learning is based on the view that knowledge is a social construct.”  (Wow, that relates to Drupal and open source projects on so many levels!)  They also explain that there are four principles to the ways collaborative learning happens, including that those who are learning are the primary focus, it is important to “do” and not just listen, working in groups is key, and the group should be learning by developing solutions to real problems.  

DrupalEasy’s learning community organically grew and developed all of these principles over the years, which is a pretty good confirmation that from both learning and solutions perspectives, we are on the right track. At the onset of each week’s office hours session, we say our hellos and figure out the first problem someone is having, or had, and the group works together to come up with a solution. There is of course also a bit of Nerd banter that keeps things fun and allows us to get to know each other a bit more. Cornell’s experts also confirm that group learning contributes to developing a lot of the soft skills (oral communication, leadership,etc.) that can help make a good developer great. We agree!

We also especially appreciate the value of the problem-solving approach to teaching, and also use it in our structured training. Cornell again has some great insight into the types and characteristics of problem solving as a mode of teaching that really resonates with us. They go in pretty broad and deep with references and explanations, so let’s pull the one element they cite that we feel we can attribute a good part of the success of our programs: “The problem is what drives the motivation and the learning.” (Boom!)  

So, knowledge is a social construct and problems motivate us to learn and figure out solutions. Working together as a community to overcome problems and build viable solutions. It’s all very Drupal-y, don’t you think?

The next session of Drupal Career Online begins March 26th. Two no-cost Taste-of-Drupal information sessions about the course are coming up at 1:30pm EST on February 28 and March 14.  Sign up!

 

Categories: Drupal

Lucius Digital: 16 Cool Drupal modules For site builders | Februari 2018

19 February 2018 - 9:37am
Drupal Doggo!

It took a while before I could write a new edition, I was just busy with the production of customer projects. Here again with a brand new version, what struck me in module updates in the past month:

1. D8 Editor Advanced link

A popular module that extends the standard editor in Drupal 8 with additional options for managing links. You can now add the following attributes:

  • title
  • class
  • id
  • target
  • rel

D8 Editor Advanced link

2. Password strength

Default password checks are stupid and annoying for the user: they can check the entered password meets certain rules, such as the number of characters and varying types herein (symbols, numbers, capital letters etc.).

This is a stupid way of checking because the password ‘Welcome123’ is accepted, while it is easy to guess.

This module enables a secure password policy by “pattern-matching” and “entropy calculation”. Almost every type of password is accepted, as long as it has sufficient entropy.

SourceHow it works

Instead of checking strict rules, this module calculates the expected time a brute force attack needs to retrieve the password. This is calculated based on underlying patterns:

  • Words that appear in a standard dictionary, common first and surnames and other default passwords.
  • Words from a dictionary, but written in Leet / 1337. For example, where the “e” is written as a three and “a” like an @.
  • A standard sequence of letters like “abcdef”, “qwerty” or “123456”
  • Dates or years.

This module has been around since 2007, I wonder why I only encounter this now :) It is currently available in alpha for Drupal 8 and stable for Drupal 7 available — it is supported by Acquia and Card.

So if you want people to not have to bother to look for a password such as “one special character, 1 upper case and at least 8 characters’, then this module offers a solution.

Password Strength

3. Better Field Descriptions

In order to give content managers issues, it is possible to write an explanation of all content fields that they import. But the standard explanation in a field in the backend of Drupal are often irrelevant, to not apply these generic texts in the implemented *user story* of the installation concerned.

After installing this module you can:

  • Content managers have their own explanation text per field.
  • Set where it stands: above or below the field.
  • The explanatory style that you like.

Better Field Descriptions

4. Better login

Want to make the standard Drupal login screen better? Then install this module and you are good to go: through template overrides you can then do the required further tuning of the layout of the login screen.

Better Login

5. Ridiculously Responsive Social Sharing Buttons

Another social sharing module, but as you see in the title: these are terribly responsive. The icons are SVG based and you need no external services such as AddThis.

Advantage: you’re less dependent and have your data in hand, downside: you have less functionality- such as comprehensive statistics.

Ridiculously Responsive Social Sharing Buttons

6. Flush Cache

If you are not using Drush or Drupal console works then you can Drupal caches flush via “the ‘Flush all caches” button in the Drupal backend. But in a production environment, you will almost never flush all caches, it can cause severe performance problems.

This module solves that problem: install it and you have more control over the caches you want to flush.

CacheFlush

7. Multiple Selects

Have your Drupal content management easier with ‘multiple selects’ administration, this image seems to me to speak for itself:

Multiple Selects

8. Neutral paths

If you are running a multilingual Drupal website, visitors can see the content in one language: the currently active language. Sometimes you would like to see pages in another language. In addition: content managers / Drupal administrators usually want English and not the backend *default language*, in our case, often Dutch.

Issue tracking for example, much easier if the backend is in English: Drupal documentation and support in English is much more available than in Dutch.

This module ensures that you can visit other pages in another language than the default. And can navigate the backend in English, while frontend is in another language.

Neutral paths

9. Password Reset Landing Page (PRLR)

Drupal core includes a ‘password’ function: If you have forgotten your password then you can request a one-time login link that is automatically mailed to you.

If you click on the login link, you will see a screen with a login button. Once you click the ‘login’ button you are logged in and you are redirected to your profile page — that’s it.

You are in this situation where your password is lost / forgotten. You are not required to change your password. This is not usually done, so people often endlessly request login links.

This module solves this: the screen where you end up after clicking on the login link not only contains a login button, but also a function to change your password immediately.

Password Reset Landing Page (PRLP)

10. Auto Purge Users

The user list in Drupal is usually not or hardly ever administered. If people have long been inactive or have not completed their registration, the account can usually be removed to avoid overhead and security issues.

This module does it for you automatically, it checks inactivity below a point and blocks users if they meet:

  • Certain time inactive.
  • Account never activated after registration.
  • Not been logged in for a period of time.

Not a popular module, but in the case of an example Drupal social intranet it can come in handy.

Auto Purge Users

11. Vertical Tabs Config

Want to influence the order of the Drupal tabs? Or do you want some tabs to not show all of your content manager? To keep tabs simple and usable you can install this module: select which tabs to show and in what order.

Modules with similar functions: Simplify and Hide vertical tabs.

Vertical Tabs Config

12. Custom Search

The default Drupal search is fine, but really standard: you have few options to tune the engine. After installing this module, changes that you can then include are:

  • Change the default label in the search box.
  • Set a default text in the search box.
  • Tune ‘Advanced Search’.
  • Change the text on the “submit button”.

And much more, see module page:

Custom Search

13. Persistent Login

Drupal 8 core does not have a ‘remember password’ function when you log in. You can remain automatically logged for some time, but that is based on a PHP session. This module does not, you can also:

  • How long users can stay logged in.
  • How many places a person can be logged in at once.
  • Select certain pages that the user must log in again at. These are usually pages where more sensitive information is available.
  • Allow the user to delete all his logins themself.

Persistent Login

14. Realistic Dummy ContentWisdom

Using the Devel module you can automatically generate content so you can see if your modules / themes work well. But it gives an unrealistic picture of the end result, this module generates more realistic images and texts.

Realistic Dummy Content

15. Password Policy

Although I am a fan of the aforementioned ‘Password strength’ module, this can also be useful if you want to make a specific password policy on your Drupal website.

Password Policy

16. Mass Password Reset

This module, we often use to implement Drupal social intranet: previously, all users and content created by an administrator on a test environment, without it people were informed through e-mail.

Once the social intranet went live, we sent all users at once an email with a login link via this module; the system was live!

Mass Password Reset

Wrap Up

So far that’s what I noticed last month in Drupal modules, stay tuned for more fat Drupal content!

Source header image

16 Cool Drupal modules For site builders | Februari 2018 was originally published in Lucius Digital | Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

Categories: Drupal

Drupalize.Me: Learn All About Using React with Drupal

19 February 2018 - 8:20am
Categories: Drupal

qed42.com: Implementing #autocomplete in Drupal 8 with Custom Callbacks

19 February 2018 - 3:59am
Implementing #autocomplete in Drupal 8 with Custom Callbacks Body

Autocomplete on textfields like tags / user & node reference helps improve the UX and interactivity for your site visitors, In this blog post I'd like to cover how to implement autocomplete functionality in Drupal 8, including implementing a custom callback

Step 1: Assign autocomplete properties to textfield

As per Drupal Change records, #autocomplete_path has been replaced by #autocomplete_route_name and #autocomplete_parameters for autocomplete fields ( More details -- https://www.drupal.org/node/2070985).

The very first step is to assign appropriate properties to the textfield:

  1. '#autocomplete_route_name':
    for passing route name of callback URL to be used by autocomplete Javascript Library.
  2. '#autocomplete_route_parameters':
    for passing array of arguments to be passed to autocomplete handler.
$form['name'] = array( '#type' => 'textfield', '#autocomplete_route_name' => 'my_module.autocomplete', '#autocomplete_route_parameters' => array('field_name' => 'name', 'count' => 10), );

Thats all! for adding an #autocomplete callback to a textfield. 

However, there might be cases where the routes provided by core might not suffice as we might different response in JSON or additional data. Lets take a look at how to write a autocomplete callback, we will be using using my_module.autocomplete route and will pass arguments: 'name' as field_name and 10 as count.

Step 2: Define autocomplete route

Now, add the 'my_module.autocomplete' route in my_module.routing.yml file as:

my_module.autocomplete: path: '/my-module-autocomplete/{field_name}/{count}' defaults: _controller: '\Drupal\my_module\Controller\AutocompleteController::handleAutocomplete' _format: json requirements: _access: 'TRUE'

While Passing parameters to controller, use the same names in curly braces, which were used while defining the autocomplete_route_parameters. Defining _format as json is a good practise.

Step 3: Add Controller and return JSON response

Finally, we need to generate the JSON response for our field element. So, proceeding further we would be creating AutoCompleteController class file at my_module > src > Controller > AutocompleteController.php.

<?php namespace Drupal\my_module\Controller; use Drupal\Core\Controller\ControllerBase; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Drupal\Component\Utility\Tags; use Drupal\Component\Utility\Unicode; /** * Defines a route controller for entity autocomplete form elements. */ class AutocompleteController extends ControllerBase { /** * Handler for autocomplete request. */ public function handleAutocomplete(Request $request, $field_name, $count) { $results = []; // Get the typed string from the URL, if it exists. if ($input = $request->query->get('q')) { $typed_string = Tags::explode($input); $typed_string = Unicode::strtolower(array_pop($typed_string)); // @todo: Apply logic for generating results based on typed_string and other // arguments passed. for ($i = 0; $i < $count; $i++) { $results[] = [ 'value' => $field_name . '_' . $i . '(' . $i . ')', 'label' => $field_name . ' ' . $i, ]; } } return new JsonResponse($results); } }

We would be extending ControllerBase class and would then define our handler method, which will return results. Parameters for the handler would be Request object and arguments (field_name and count) passed in routing.yml file. From the Request object, we would be getting the typed string from the URL. Besides, we do have other route parameters (field_name and Count) on the basis of which we can generate the results array. 

An important point to be noticed here is, we need the results array to have data in 'value' and 'label' key-value pair as we have done above. Then finally we would be generating JsonResponse by creating new JsonResponse object and passing $results.

That's all we need to make autocomplete field working. Rebuild the cache and load the form page to see results.

PURUSHOTAM RAI Mon, 02/19/2018 - 17:29
Categories: Drupal

jmolivas.com: Try Drupal 8.5 and umami profile using one command

19 February 2018 - 12:23am
Try Drupal 8.5 and umami profile using one command jmolivas Mon, 02/19/2018 - 08:23 Body

If you are following the upcoming release of Drupal 8.5 you might be aware of the umami profile. This installation profile is part of the Out of The Box experience initiative. The goal of this profile is to add sample content presented in a well-designed theme, displayed as a food magazine. Using recipes and feature articles this example site will make Drupal look much better right from the start and help evaluators explore core Drupal concepts like content types, fields, blocks, views, taxonomy, etc.

Categories: Drupal

Roy Scholten: Tweets starting from here

18 February 2018 - 2:55pm
18 Feb 2018 /sites/default/files/styles/large/public/20180219-notes-ui.png?itok=Xp6Vepyy Tweets starting from here

My previous post inspired Joeri to some improvements on his site. Nice!

I built another step towards POSSE this weekend: tweet-sized notes posted as content on yoroy.com that get pushed to Twitter via RSS and Zapier. Here’s how:

Create a new content type “Note”. This one needs to only have a text area. And here we run into Drupal always requiring a title. We can’t create entities without giving it a title. The title itself is always a text field, so not ideal for writing 280 char bits of text. Two contrib modules to work around this:

  • Auto entity label to define an automatic pattern for the title of these Notes. I set it to use a simple timestamp.
  • Exclude node title to actually hide the title field on the Note creation form and on display.

Next I defined a new text format that does not use CKEditor but allows tags and automatically transforms URLs into links. I set this to be the default text format for the text area on the Note using the Better Formats module (sadly currently only available as an old development release). This step is optional, it helps remove user interface clutter. This gives me a content creation form with just a single plain text text area, a “published” checkbox and a Save button.

I updated the views that list blog content on this site to also include content of type “Note” and configured a Notes RSS feed as well. I use this feed as an input on Zapier where the Notes body is extracted and posted as a tweet.

Tags posse twitter Drupal content modeling drupalplanet
Categories: Drupal

Matt Glaman: Florida Drupal Camp: a return four years in the making

17 February 2018 - 4:25am
Florida Drupal Camp: a return four years in the making mglaman Sat, 02/17/2018 - 06:25

Five years ago I went to my second Drupal Camp and first Drupal Camp that I presented at. It has been four years, but I am finally going back to Florida Drupal Camp. I am pretty excited, as a lot has changed since then.

Categories: Drupal

Pages