Drupal

Perspective API

New Drupal Modules - 24 February 2017 - 9:50am

Perspective API integrates Google perspective.

Development has started recently and an API key is requested for testing so unfortunately there is nothing to show here yet.

Categories: Drupal

Acquia Lightning Blog: Extending Lightning - Part II

Planet Drupal - 24 February 2017 - 9:48am
Extending Lightning - Part II Adam Balsam Fri, 02/24/2017 - 12:48 History

One of the problems with Drupal distributions is that they, by nature, contain an installation profile — and Drupal sites can only have one profile. That means that consumers of a distribution give up the ability to easily customize the out of the box experience.

This was fine when profiles were first conceived. The original goal was to provide “ready-made downloadable packages with their own focus and vision”. The out of the box experience was customized by the profile, and then the app was built on top of that starting point. But customizing the out of the box experience is no longer reserved for those of us that create distributions for others to use as a starting point. It’s become a critical part of testing and continuous integration. Everyone involved in a project, including the CI server, needs a way to reliably and quickly build the application from a single command. Predictably, developers have looked to the installation profile to handle this.

This practice has become so ubiquitous, that I recently saw a senior architect refer to it as “the normal Drupal paradigm of each project having their own install profile”. Clearly, if distributions want to be a part of the modern Drupal landscape, they need to solve the problem of profiles.

Old Approach

In July 2016, Lightning introduced lightning.extend.yml which enabled site builders to:

  1. Install additional modules after Lightning had finished its installation
  2. Exclude certain Lightning components
  3. Redirect users to a custom URL upon completion

This worked quite well. It gave site builders the ability to fully customize the out of the box experience via contrib modules, custom code, and configuration. It even allowed them to present users with a custom “Installation Done” page if they chose — giving the illusion of a custom install profile.

But it didn’t allow developers to take full control over the install process and screens. It didn’t allow them to organize their code they way they would like. And it didn’t follow the “normal Drupal paradigm” of having an installation profile for each project.

New Approach

After much debate, the Lightning team has decided to embrace the concept of “inheriting” profiles. AKA sub-profiles. (/throws confetti)

This is not a new idea and we owe a huge thanks to those that have contributed to the current patch and kept the issue alive for over five years. Nor is it a done deal. It still needs to get committed which, at this point, means Drupal 8.4.x.

On a technical level, this means that — similar to sub-themes — you can place the following in your own installation profile’s *.info.yml file and immediately start building a distribution (or simply a profile) on top of Lightning:

base profile: name: lightning

To encourage developers to use this method, we will also be including a DrupalConsole command that interactively helps you construct a sub-profile and a script which will convert your old lightning.extend.yml file to the equivalent sub-profile.

This change will require some rearchitecting of Lightning itself. Mainly to remove the custom extension selection logic we had implements and replace it with standard dependencies.

This is all currently planned for the 2.0.5 release of lightning which is due out in mid March. Stay tuned for updates.

Categories: Drupal

Jeff Geerling's Blog: Thoughts on the Acquia Certified Front end Specialist - Drupal 8 Exam

Planet Drupal - 24 February 2017 - 8:58am

Another day, another Acquia Developer Certification exam review (see the previous one: Certified Back end Specialist - Drupal 8, I recently took the Front End Specialist – Drupal 8 Exam, so I'll post some brief thoughts on the exam below.

Categories: Drupal

Drupal core announcements: 8.3.0 release candidate phase begins week of February 27; no Drupal 8.2.x or 7.x patch release planned

Planet Drupal - 24 February 2017 - 8:08am
Drupal 8.3.0 release candidate phase

The release candidate phase for the 8.3.0 minor release begins the week of February 27. Starting that week, the 8.3.x branch will be subject to release candidate restrictions, with only critical fixes and certain other limited changes allowed.

8.3.x includes new experimental modules for workflows, layout discovery and field layouts; raises stability of the BigPipe module to stable and the Migrate module to beta; and includes several REST, content moderation, authoring experience, performance, and testing improvements among other things. You can read a detailed list of improvements in the announcements of alpha1 and beta1.

Minor versions may include changes to user interfaces, translatable strings, themes, internal APIs like render arrays and controllers, etc. (See the Drupal 8 backwards compatibility and internal API policy for details.) Developers and site owners should test the release candidate to prepare for these changes.

8.4.x will remain open for new development during the 8.3.x release candidate phase.

Drupal 8.3.0 will be released on April 5th, 2017.

No Drupal 8.2.x or 7.x releases planned

March 1 is also a monthly core patch (bug fix) release window for Drupal 8 and 7, but no patch release is planned. This is also the final bug fix release window for 8.2.x (meaning 8.2.x will not receive further development or support aside from its final security release window on March 15). Sites should plan to update to Drupal 8.3.0 on April 5.

For more information on Drupal core release windows, see the documentation on release timing and security releases, as well as the Drupal core release cycle overview.

Categories: Drupal

Sports League

New Drupal Modules - 24 February 2017 - 7:37am

Sports League module is an out of the box solution to manage sports league functionality in Drupal. It relies on popular modules in drupal to help manage content typically used in websites for sports clubs. Main example is derived from football clubs, but can be easily extended.

Functionality included:
- Manage competitions, multi competition editions and its standings.
- Manage clubs and teams.
- Manage matches, rosters and match moments.
- Manage players.
- Manage automatic statistics on players and teams.
- Manage club titles.

Categories: Drupal

CiviCRM Blog: The quest for performance improvements - 6th sprint

Planet Drupal - 24 February 2017 - 5:59am

In this blog I want to explain the round up we have done around the refactoring of the acl_contact_cache. In the previous sprints we discovered that a lot of the performance was slowed down by the way the acl_contact_cache was used (or rather not used at all). See also the previous blog post: https://civicrm.org/blog/jaapjansma/the-quest-for-performance-improvements-5th-sprint

At the socialist party they have 350.000 contacts and around 300 users who can access civicrm. Most of the users are only allowed to see only the members in their local chapter.

In the previous blog we explained the proof of concept. We now have implemented this proof of concept and the average performance increase was 60%.

We created a table which holds which user has access to which contacts. We then fill this table once in a few hours. See also issue CRM-19934 for the technical implementation of this proof of concept.

Performance increase in the search query

In the next examples we are logged in as a local member who can only see members in the chapter Amersfoort. We then search for persons with the name 'Jan'. And we measure how long the query for searching takes.

The query for presenting the list with letters in the search result looks like

SELECT count(DISTINCT contact_a.id) as rowCount FROM civicrm_contact contact_a LEFT JOIN civicrm_value_geostelsel geostelsel ON contact_a.id = geostelsel.entity_id LEFT JOIN civicrm_membership membership_access ON contact_a.id = membership_access.contact_id WHERE ((((contact_a.sort_name LIKE '%jan%')))) AND (contact_a.id = 803832 OR (((( ( geostelsel.`afdeling` = 806816 OR geostelsel.`regio` = 806816 OR geostelsel.`provincie` = 806816 ) AND ( membership_access.membership_type_id IN (1, 2, 3) AND ( membership_access.status_id IN (1, 2, 3) OR (membership_access.status_id = '7' AND (membership_access.end_date >= NOW() - INTERVAL 3 MONTH)) ) ) ) OR contact_a.id = 806816 )) AND (contact_a.is_deleted = 0) )) ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc;

As you can see that is quite a complicated query and includes details about which members the user is allowed to see.  Only executing this query takes around 0.435 seconds and the reason is that mysql has to check each record in civicrm_contact (which in this case is around 350.000 and growing)

After refactoring the acl cache functionality in CiviCRM Core the query looks different:

SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name  FROM civicrm_contact contact_a INNER JOIN `civicrm_acl_contacts` `civicrm_acl_contacts` ON `civicrm_acl_contacts`.`contact_id` = `contact_a`.`id`  WHERE  (((( contact_a.sort_name LIKE '%jan%' ))))  AND  `civicrm_acl_contacts`.`operation_type` = '2' AND `civicrm_acl_contacts`.`user_id` = '803832' AND `civicrm_acl_contacts`.`domain_id` = '1' AND (contact_a.is_deleted = 0)    ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc

The query now takes around 0,022 seconds to run (20 times faster).

Explanation

How does this new functionality works:

1. Every time an ACL restriction is needed in a query civicrm core only does an inner join on the civicrm_acl_contacts table and that is all

2. The inner join is generated in the service 'acl_contact_cache'  that service also checks whether the the civicrm_acl_contacts table need to be updated or not.

3. When an update of civicrm_acl_contacts table is needed depends on the settings under administer --> System Settings --> Misc --> ACL Contact Cache Validity (in minutes)

So how does this look like in code?

Below an example of how you could use the acl_contact_cache service to inject acl logic into your query:

// First get the service from the Civi Container $aclContactCache = \Civi::service('acl_contact_cache'); // The $aclContactCache is a class based on \Civi\ACL\ContactCacheInterface // Now get the aclWhere and aclFrom part for our query $aclWhere = $aclContactCache->getAclWhereClause(CRM_Core_Permission::VIEW, 'contact_a'); $aclFrom = $aclContactCache->getAclJoin(CRM_Core_Permission::VIEW, 'contact_a'); // Now build our query $sql = "SELECT contact_a.* FROM civicrm_contact contact_a ".$aclFrom." WHERE 1 AND ".$aclWhere; // That is it now execute our query and handle the output...

The reason we use a service in the Civi Container class is that it is now also quite easy to override this part of core in your own extension.

The \Civi\ACL\ContactCache class has all the logic to for building the ACL queries. Meaning that this class contains the logic to interact with the ACL settings in CiviCRM, with the permissioned relationship etc.. All those settings are taken into account when filling civicrm_acl_contacts table which is per user and per operation once in the three hours.

 

Drupal
Categories: Drupal

Entity Submenu Block

New Drupal Modules - 24 February 2017 - 5:28am

This Drupal 8 module is meant for the fairly common use case of displaying the current page's submenu items as rendered content entities (typically in the 'teaser' or similar view mode).

You can add Entity Submenu Blocks from the Block layout page and configure the view modes that should be used for different content entity types. By default only menu items for content entities are rendered, but there is an option to render other menu items as simple links too.

Categories: Drupal

Keep referenced entities

New Drupal Modules - 24 February 2017 - 1:16am

Provides protecting some entities from deletion if they are used in other entities.

Categories: Drupal

InternetDevels: What type of Drupal developer do you need for your project?

Planet Drupal - 24 February 2017 - 12:16am

If you want to create a web resource, or to implement certain improvements on an existing one, then you must find specialists who will make your ideas come true. It’s quite a challenging task. We offered our 10 tips for hiring a top web developer by mentioning qualities that must be possessed. However, in addition, there are different types of web developers, with different skills, duties and types of work. The objectives and the scale of your project require appropriate experts.

Read more
Categories: Drupal

Unimity Solutions Drupal Blog: Drupal 8 as an Enterprise Web Content Management System

Planet Drupal - 23 February 2017 - 10:30pm

Drupal 8 integrating with Traditional ECMs to enhance Enterprise Content Management Capabilities. Drupal 8 is a strong platform with it’s Strong Web Content Management System, has a role to Play in integrating with the existing Challengers/Traditional ECMs to enhance their Enterprise Content Management Capabilities.

Categories: Drupal

Amount

New Drupal Modules - 23 February 2017 - 10:27pm

A numerical field with enormous range, high precision, efficient storage and computational properties, and associated units property

Categories: Drupal

Commerce Abandoned Carts

New Drupal Modules - 23 February 2017 - 9:01pm

This module will automatically send a email messages to users who have abandoned their Drupal Commerce carts.

On each cron run the module finds Drupal Commerce carts that have been abandoned (using configurable settings) and that the user has gone to the point in the checkout process to have entered their email address. Then the module will send an email message to the user(s) to remind them that they have a cart, or ask if they had an issue during checkout.

Email messages are fully customizable. Message limits and other options are configurable in the module settings.

Categories: Drupal

PreviousNext: Faster Hierarchies with Nested Sets and the Entity Reference Hierarchy module.

Planet Drupal - 23 February 2017 - 7:26pm
In Drupal 7 we used Node Hierarchy module to keep track of a hierarchy of pages. Node hierarchy ties directly to the menu system. When getting a list of all ancestors or descendents, it is a O(n) operation, and at least one site we use it on has a lot of nodes in the tree. Performance was terrible. Add to that it has no notion of revisions or forward revisions, so changing the parent and saving a draft can cause all sorts of issues with your menu.   When the time came to update the site to Drupal 8, we took a different approach.
Categories: Drupal

Freelock : Book 3: Metrics to success and selecting a vendor

Planet Drupal - 23 February 2017 - 2:10pm

When thinking about ways to measure your website’s effectiveness, you may also want to think about the metrics you use to gauge the success of the website in accomplishing your business goals. How else do you measure success?

Categories: Drupal

DrupalCon News: Level up your Drupal skills with our training courses, now available for sign-ups

Planet Drupal - 23 February 2017 - 1:34pm

Thirsty for Drupal knowledge? Want to dive deep into a topic and learn from the best in the field? Like to get hands-on with your learning material? We are excited to offer 10 full-day training classes at DrupalCon Baltimore that will turn you into a Drupal superhero. No matter if you are an absolute beginner or Drupal expert, our classes cover all experience levels.

Categories: Drupal

DrupalCon News: Drupal Association Welcomes 17 Grant and Scholarship Recipients

Planet Drupal - 23 February 2017 - 9:42am

Our community is made up of incredible members from across the globe who continue to grow the Drupal project and create communities. DrupalCon is a place where community leaders and key contributors come together to meet, learn, and collaborate. The Drupal Association's Grant and Scholarship Program makes attending possible for many community members who may not have been otherwise able to join us.  

Categories: Drupal

Drupal Association blog: Doing our part for the community

Planet Drupal - 23 February 2017 - 9:25am

The Drupal Association Engineering Team delivers value to all who are using, building, and developing Drupal. The team is tasked with keeping Drupal.org and all of the 20 subsites and services up and running. Their work would not be possible without the community and the project would not thrive without close collaboration. This is why we are running a membership campaign all about the engineering team. These are a few of the recent projects where engineering team + community = win!

Want to hear more about the work of the team, rather than read about it? Check out this video from 11:15-22:00 where Tim Lehnen (@hestenet) talks about the team's recent and current work.

Leading the Documentation System migration

We now have a new system for Documentation. These are guides Drupal developers and users need to effectively build and use Drupal. The new system replaces the book outline structure with a guides system, where a collection of pages with their own menu are maintained by the people who volunteer to keep the guides updated, focused, and relevant. Three years of work from the engineering team and community collaborators paid off. Content strategy, design, user research, implementation, usability testing and migration have brought this project to life.


Pages include code 'call-outs' for point-version specific information or warnings.

Thanks to the collaborators: 46 have signed up to be guide maintainers, the Documentation Working Group members (batigolix, LeeHunter, ifrik, eojthebrave), to tvn, and the many community members who write the docs!

Enabling Drupal contribution everywhere

Helping contributors is what we do best. Here are some recent highlights from the work we're doing to help the community:

Our project to help contributors currently in development is revamping the project applications process. More on this soon on our blog.

When a community need doesn't match our roadmap

We have a process for prioritizing community initiatives so we can still help contributors. Thanks to volunteers who have proposed and helped work on initiatives recently, we've supported the launch of the Drupal 8 User guide and the ongoing effort to bring Dreditor features into Drupal.org itself.  

Thanks to the collaborators: jhodgdon, eojthebrave, and the contributors to the user guide. Thanks also to markcarver for the Dreditor effort.

How to stay informed and support our work.

The change list and the Drupal.org roadmap help you to see what the board and staff have prioritized out of the many needs of the community.

You can help sustain the work of the Drupal Association by joining as a member. Thank you!

Categories: Drupal

PostUp Mail

New Drupal Modules - 23 February 2017 - 5:34am

PostUp Mail module provides a integration with PostUp.com service.
This module is only for developers.

How to use: \Drupal::service('postup_mail.sender')->send_mail_template('example@example.com');

or dinamyc

Categories: Drupal

Toggle Optional Fields

New Drupal Modules - 23 February 2017 - 2:55am
Categories: Drupal

Zhilevan Blog: REST Authentication in Decoupled Drupal

Planet Drupal - 22 February 2017 - 11:22pm
In the traditional Drupal site, you don’t need to handle authentication, because Drupal handle everything by itself, gets a cookie, set session, error handling etc. But what about decoupled(headless drupal) sites? How can we authenticate the user on decoupled? Before diving into this, we need to understand the authentication types provided by RESTful:
Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal