KnackForge: How to update Drupal 8 core?

Planet Drupal - Sat, 2018/03/24 - 6:01am
How to update Drupal 8 core?

Let's see how to update your Drupal site between 8.x.x minor and patch versions. For example, from 8.1.2 to 8.1.3, or from 8.3.5 to 8.4.0. I hope this will help you.

  • If you are upgrading to Drupal version x.y.z

           x -> is known as the major version number

           y -> is known as the minor version number

           z -> is known as the patch version number.

Sat, 03/24/2018 - 10:31
Categories:

Valuebound: Drupal 8: How to create a custom block programatically

Planet Drupal - Mon, 2016/12/19 - 8:33am
Drupal 8: How to create a custom block programatically Jaywant.Topno Mon, 12/19/2016 - 02:33
Categories:

Valuebound: Drupal 8: Custom Block Creation programmatically

Planet Drupal - Mon, 2016/12/19 - 8:33am
Drupal 8: Custom Block Creation programmatically Jaywant.Topno Mon, 12/19/2016 - 02:33
Categories:

Phponwebsites: Pathauto added special characters in url alias - drupal 7

Planet Drupal - Wed, 2016/07/27 - 9:54pm
    To improve SEO, we need to clean our URLs. By default in drupal, we've an option called clean URLs at the configuration. In drupal 7, we can also manage the URLs. For instance, you have a content type called services. You wanted to each service page have url like services/page-name. To do that, we've a pathauto module in drupal 7. The pathauto module allow us to manage the URLs for every content types, files, taxonomy & users and also we can remove some unnecessary words from URL like an, the and so on.

   The pathauto module can remove some unnecessary words like a, an, the and so on & also remove special characters like !, @, $ and so on. Unfortunately, it doesn't included some other symbols like copyright(©), trademark(™), registered(®) and so on. But it provide a hook to add new symbols into the punctuation settings called hook_pathauto_punctuation_chars_alter. After created a content with some symbols which are represented above, your page URL looks like below image:





/**
 * Implements hook_pathauto_punctuation_chars_alter().
 */
function phponwebsites_pathauto_punctuation_chars_alter(array &$punctuation) {
  $punctuation['copyright']          = array('value' => '©', 'name' => t('Copyright'));
  $punctuation['registered']         = array('value' => '®', 'name' => t('Registered trademark'));
  $punctuation['trademark']          = array('value' => '™', 'name' => t('Trademark'));
}
   After implemented above code into your module, you cold see added symbols are listing on Pathauto module's settings page at /admin/config/search/path/settings. If You didn't get these symbols, clear cache & test it again. It looks like below image:




Now you can create a content with those symbols. The pathauto module didn't added those symbols into the URL.

Now I hope you know how to remove some special characters from URL alias using pathauto module in drupal 7.
Categories:

Arpit Jalan: GSOC 2016- Developing tests for “Fil Alt Text” feature of Google Vision module- Week 9

Planet Drupal - Wed, 2016/07/27 - 7:01pm
TL;DR Last week, I had worked on and developed tests to ensure that the similar images are grouped in accordance to the Image Properties feature of the Vision API. The code is under review by the mentors, and I would continue on it once the review is done. Meanwhile, they also reviewed the “Fill Alt Text” feature issue, and approved it is good to go. This week, I have worked on developing tests for this issue.

An important feature that I have implemented in the Google Vision API module is the filling of Alt Text field of an image file entity by any of the four choices- Label Detection, Landmark Detection, Logo Detection and Optical Character Detection. My mentor suggested me to check the availability of the response and then fill the field, as we can not fully rely on the third party responses. With this minor suggestion being implemented, now its time to develop tests to ensure the functionality of this feature.

I started developing simple web tests for this feature, to ensure that the Alt Text field is properly filled in accordance to the choice of the user. It requires the selection of the four choices one by one and verify that the field is filled correctly. Thus we require four tests to test the entire functionality. I have added an extra test to ensure that if none of the options are selected then the field remains empty.

I created the image files using the images available in the simpletests. The images can be accessed through drupalGetTestFiles(). The filling, however, requires call to the Google Cloud Vision API, thus inducing dependency on the API key. To remove the dependency, I mocked the function in the test module, returning the custom data to implement the feature.

The first test ensures that the Label Detection feature returns correct response and the Alt Text field is filled correctly. The simpletest provides a list of assertions to verify it, however, I found assertFieldByName() to be most suitable for the purpose. It asserts the value of a field based on the field name. The second test ensures that the Landmark Detection feature works correctly. Similarly, the third and fourth test ensures the correct functionality of the Logo and the Optical Character Detection feature.

The fifth test which I have included perform tests when none of the options are selected. It ensures that under this case, the Alt Text field remains empty, and does not contain any unwanted values.
I have posted the patch covering the suggestions and tests on the issue queue Fill the Alt Text of the Image File using Google Vision API to be reviewed by my mentors. Once they review it, I would work on it further, if required.
Categories:

Microserve: DrupalCamp Bristol 2016 - Chairman's Write-up

Planet Drupal - Wed, 2016/07/27 - 6:13pm
DrupalCamp Bristol 2016 - Chairman's Write-upJul 27th 2016

DrupalCamp Bristol 2016 was held over this last weekend, and I hope I'm not the only one to say it was an enjoyable and very useful weekend for many. Although there were a couple of usual hiccups, feedback from attendees was very positive and certainly made it all feel worthwhile. Let's hope that wasn't just the beer talking!

Last year I wrote up some tips and feedback after the event, and as the Chair of the DCB Committee I thought it would be great to share my thoughts again this year. After all, Drupal as a community is based upon being open, so behind the scenes camp organisation should be too!

What went well?

Let's start of with the positives:

  • Business Day - In general the Business Day was a fantastic success. We had an increased number of attendees this year which included a larger number of client types, the talks were well varied and lived up to the high expectations set last year, and our new venue - Colston Hall - was a fantastic choice. The weather was brilliant and attendees were able to chat with each other outside on the roof terrace which was a great feature.
  • Quality of Saturday talks - I'll give a bit more insight into the talks shortly, but this year we managed to put together a larger number of talks without sacrificing any quality. Last year almost all of the talks were of a technical nature, but this year we managed to get a better variety which is the first step to brining in newer faces.
  • Sponsors - This year we completely changed the Sponsor tiers up, allowing us to reduce the number of agency types involved. We had 4 key Organisational Sponsors, a Recruitment Sponsor, and a couple of "Brunel tier" Sponsors, which was well received. I think I'm correct in saying that most of the Org Sponsors have an existing relationship with the Recruitment Sponsor, so we were able to pick somebody we trusted for the exclusive Sponsor role.
  • Quiz - This year we ended the Saturday talks at 3.30pm and finished with a Quiz instead for a lighter end to the day. Admittedly the questions were a bit hard and in some cases....different, but the teams soon began to laugh at it and with a load of prizes to give away it was a win-win situation for everybody!
  • Social - We invested heavily in bar tabs both Friday and Saturday, with a total of £1K budgeted between both evenings, and this was definitely worthwhile. For the Business Day attendees the socials are where the networking is most prominent, and for developers the socials are where most people really seem to bond. Personally I think the relationships which are forged at the socials are key to ensuring the regular faces return each year, as this is where you get a real sense of community and team spirit.
  • Sprints - We held a day of Sprints for the first time and we had to stop ticket sales as this had reached maximum capacity. Thanks to Torchbox for letting us use their offices for this one.
  • Use of Slack - The committee was much more dispersed this year, but using Slack as a communication tool made things much simpler and ensured the remote factor didn't play against us.
What didn't go so well?

There were a few things that concerned me, and although some where event specific I think there's some wider problems that are becoming apparent in the Drupal Community. I'd be really keen to hear how we as a community can go about improving these:

  • New talent is lacking - It was great to hear during Sheena Morris's Apprenticeships talk that agencies in the North and in London have adopted their Apprenticeship program so well, but Saturday's attendees showed that there is a huge lack of new Drupal talent. Emma Jane won "Learning Drupal 8" during the Quiz which was kindly provide by Inviqa, and gifted it to the person in the room who was newest to Drupal. The person in the room with the least Drupal experience had just less than 2 years!
  • Female speakers are sparse - Speaker diversity is a problem which isn't new to us, and this year we only had one female speaker per day. What's troublesome about that is that we didn't have a single talk submission from a female to choose from; it was committee members who sourced both of those speakers.
  • Last minute program changes - I guess this one is unavoidable, but 3 speakers dropped out of Saturday within a week of the event, and upon arriving at the venue on Saturday morning we were told the main lecture theatre was out of use and we had to direct talks to another lecture theatre. Typical! It would be interesting to know how other camps deal with this; maybe we shouldn't include the Saturday schedule in the printed programme, but instead ensure attendees use the website as the primary source of this info?
Camp Funds, DCB 2017, and the Committee

We've estimated an income of £11K this year, with expenditure of just short of £10K. We started the year with a cushion of approximately £4K from last year's camp, which gives us around £5K to rollover. I personally think it would be great to invest some of this into the local Drupal community, perhaps sponsoring more regular talk nights and Sprints? I'd be interested to hear of any suggestions - tweets to @DrupalCampBris.

The committee will be having a wash up meeting over the next week to discuss next year and see what we can do to improve the event, but I can guarantee you DrupalCamp Bristol 2017 will certainly be happening. Organisation will begin again later this year, and as the committee is always in need of new members we'd be interested to know if anybody new would like to join the team? Again, simply tweet @DrupalCampBris if you'd like to get involved.

Finally, I'd like to take this chance to offer up the Committee Chair position as I've decided to take a step down to a more back seat next year. I've thoroughly enjoyed leading the team over the first 2 years, but I think it would be good to see somebody else step into the role next year.

A massive thank you to everybody who attended, thank you to all the Speakers who volunteered their time over the weekend, thank you to all the Sponsors who made the event possible, and a huge thank you to all the committee members for pulling everything together and making the event a success.

See you all next year!

Written by: Rick Donohoe, Account Manager

Microserve is a Drupal Agency based in Bristol, UK. We specialise in Drupal Development, Drupal Site Audits and Health Checks, and Drupal Support and Maintenance. Contact us for for further information.

Categories:

Miloš Bovan: GSoC ‘16 - Week #10: Mailhandler updates

Planet Drupal - Wed, 2016/07/27 - 5:29pm
GSoC ‘16 - Week #10: Mailhandler updates

This blog post summarizes week #10 of the Google Summer of Code 2016 project - Mailhandler.

In the last blog post, I was writing about the comment and demo module improvements. This blog post will provide an overview of the work done in the past 7 days. Even though the plan was to work mostly on UI/UX issues we ended up in code refactoring.

During the last meeting with my mentors we identified 3 key Inmail issues to work on: Lack of standard result in collaboration of analyzers, Support switching the user context and Provide a hook_requirements fed by plugin instances. We agreed those issues will provide better overall value in the integration of Mailhandler and Inmail modules. It will allow Inmail to implement ideas from Mailhandler, make them generic in a way both modules can benefit from.

Lack of standard result in collaboration of analyzers was identified as the main blocker to achieve analyzer collaboration. After a long discussion and 7 patches, it was finally committed. As a result, Inmail will have a default analyzer result which can be extended sequentially by all enabled analyzers. As this was a big change in core Inmail module, there are several follow-ups created.

Another Inmail issue Support switching the user context was dependent on the default analyzer issue. It uses AccountSwitcher service which completely switches the user context to the given user/account. That is done after the handlers run. In case the account switching mechanism was activated, we make sure it is switched back after the handlers-processing. On a handler level, we can use \Drupal::currentUser() and be sure it represents the identified user sender or an anonymous user otherwise.

Last but not least, I have been working on Provide a hook_requirements fed by plugin instances. The goal of this issue is to create a way for each of the Inmail plugins (analyzers, deliverers, handlers) to provide information about its runtime requirements. They can be PHP extension requirements, valid credentials etc. This information is displayed on “Status report” page (admin/reports/status) or processed by contrib modules like Monitoring.

PGP Analyzer requirements

Inmail plugins can produce several issues with unmet requirements. As displayed in the picture above, PGP Analyzer needs gnupg PHP extension in order to work with signed messages. On the other side, an IMAP deliverer needs valid credentials to be functional.

Since the most of the Inmail issues mentioned above were committed, Mailhandler module will need adaption which is going to be my focus for this week. Also, I will analyze the code of the module and try to simplify it. Besides the mentioned, I will work on Inmail UI/UX issues which will be described in the next blog post.

 

 

 

Milos Wed, 07/27/2016 - 17:29 Tags Drupal Open source Google Summer of Code Drupal Planet Add new comment
Categories:

GVSO Blog: [GSoC 2016: Social API] Week 9: Social Post implementer - Part II

Planet Drupal - Wed, 2016/07/27 - 2:13pm
[GSoC 2016: Social API] Week 9: Social Post implementer - Part II

With this week over, we are getting closer to GSoC final evaluations. Therefore, we keep working hard to develop the Social API project even further. This week, I focused on Social Post Twitter as I mentioned in my last weekly summary. This module works as an implementer of Social Post.

gvso Wed, 07/27/2016 - 08:13 Tags Drupal Drupal Planet GSoC 2016
Categories:

Deeson: 7 facts that reveal the state of Drupal

Planet Drupal - Wed, 2016/07/27 - 1:34pm

Drupal 8 was released on the 19th of November, 2015. Just a touch under five years from the 5th of January, 2011 release of Drupal 7. In web terms, an epoch. To put things in context, in 2011 AngularJS had not reached 1.0, React was two years out from being released and the term “Devops” was only whispered in dark corridors. Now that Drupal 8 is finally here the front-end revolution is led by AngularJS and React and articles are proclaiming that “DevOps is dead”. In short, much has changed.

Understandably, this has created some concern within the Drupal community. Has the huge Drupal 8 release cycle hurt Drupal in some irrevocable way? Is Drupal still a relevant technology? Is it too little too late or, as some argue, too much too late?

At the New Orleans DrupalCon, roughly six months after the release of Drupal 8, many were trying to glean some answers from available data. One fact cited is that after the first three months of the Drupal 8 release there were roughly 60,000 sites compared to 30,000 in the equivalent time period for Drupal 7. However, others argued that that is not necessarily a positive number because (as is pointed out here) the Drupal community is also three times bigger now.

In addition, the reasons that are holding people back from moving to D8 were discussed. Dries Buytaert’s keynote at the New Orleans DrupalCon covers that very well, with the leading factor being the migration of existing modules from Drupal 7 to Drupal 8.

However, as Dries goes on to explain, the number of sites and the number of upgraded modules are not the only relevant metrics. He argues that this increase in the richness and reach of Drupal will ultimately mean that Drupal 8 will see much bigger numbers than any other Drupal release.

What I will attempt to do in this blog post is add to the discussion by offering some simple facts that are very revealing about the actual state of Drupal and are relevant to any organisation trying to decide whether Drupal should form a component of their web strategy for the next five years.

Millions in ongoing investment by the Drupal community

2016 marks the year where it is no longer a novelty for leading Drupal agencies to employ people with a very specific mandate of working directly on Drupal core issues, or large Drupal 8 contrib modules (here at Deeson this is exactly what we do with the Group module, Rainmaker, Warden and our monthly Coder Lounge). The amount of ongoing direct investment from Drupal agencies and other organisations easily runs into multiple millions.

$500,000 invested to accelerate Drupal 8 module development

Acquia alone is investing $500,000 to speed-up the migration of popular Drupal 7 modules to Drupal 8. This means that popular modules will be ready faster and, more importantly, the quality of those modules will be higher as the maintainers will be able to dedicate focused time to get upgrades right. Using Drupal 8 means you are using an open-source CMS that is built to very high standards from some of the best developers around.

Big site wins are no longer big news

There was a time when a big site launching on Drupal would represent headline news in the community. It would receive applause at conferences and would be tweeted widely. This is no longer the case. Everyone is still happy to hear about big names joining Drupal but it is not news, it is the normal state of affairs.

These big launches span from media brands like ITV to multinationals like Johnson & Johnson; from pop singers to large cultural institutions. While the absolute number of sites running a CMS is important, the number of large complex sites using Drupal is arguably more significant to an organisation looking to set out its strategy for the next 5 years.

DrupalCon isn’t just about Drupal anymore

If you haven’t attended a DrupalCon yet, you should. One of the most interesting ways DrupalCons have evolved in the past few years is that they are no longer just about Drupal. There are dedicated tracks on project management, business development, user experience, PHP, front end technologies and much more. This is proof of a maturing community.

As the community has matured, interests have become more diverse and the breadth of shared practices has grown. Drupal has community sharing in its DNA which means that, by using Drupal, you are tapping into a very rich world that is willing to share knowledge about every aspect of a web strategy.

Drupal 8 is actually already at 8.1.7

The Drupal release cycle has changed drastically from 7 to 8. This is an often overlooked “feature” of Drupal 8. While with Drupal 7 we essentially had the sum of features at the start and new functionality could only really develop through contributed modules, Drupal 8 brings minor releases that can add completely new functionality.

To prove the point we are already at Drupal 8.1.7 with Drupal 8.1.0 seeing exciting new features such as the addition of the BigPipe technique to Drupal. This finally allows Drupal to adapt and adjust its course, and the days of worrying about Drupal becoming irrelevant as the rest of the web marches on are behind us.

There are 17 external JS Libraries and 27 external PHP Libraries in Drupal 8

Drupal 8 core contains at least 17 significant JavaScript libraries and 27 PHP libraries that are completely separate open-source projects. Drupal has well and truly built bridges to other technology islands and this also makes Drupal stronger, more relevant and more resilient to changes.

You can build a Drupal site with 0% Drupal on the frontend.

0 is a strange number to be touting as a success. But Drupal 8 now realistically allows you to build a front end that is 100% Drupal free. At Deeson we are currently building amazing front end experiences using React and taking advantage of Drupal’s powerful content model to store information and allow editors to quickly add and update information. The wider community is developing modules and best practices around this (for example, the great work happening around the Decoupled Blocks module).

Now, given the above is Drupal a relevant technology for a modern, forward-looking web strategy? All indications point to an unequivocal yes. Drupal 8 is more relevant than ever. It is the most advanced open-source CMS and it is built in a way that allows it to embrace and enhance a range of other technologies. The best news is that we are just at the start of what Drupal 8 will be able to do and, as best practices and experience accrues, the possibilities and the efficiency with which projects can be delivered will improve.

Want to know more about this topic? We're holding a webinar on the current state of Drupal and where it's headed. During the webinar you'll have the chance to ask Ronald Ashri, author of this post, any questions you like on this topic.

Interested? Sign up using the form at the top of this page.

 

Categories:

Into my Galaxy: GSoC’ 16: Port Search Configuration module; coding week #9

Planet Drupal - Wed, 2016/07/27 - 12:12pm

I am part of the Search Configuration module porting process to Drupal 8 as part of the Google Summer of Code’ 16. I have been mentored by Karthik Kumar, Naveen Valecha and Neetu Morwani. If you would like to have a quick look at my works so far, please go through these posts.

The past week I worked on fixing some of the issues in the port process. Moreover, I could learn some important concepts in the process. I ported the helper functions of the search configuration settings to the form API.

Basically, settings were stored as helper functions in the Drupal 7 module. I ported the helper functions of the search configuration settings to the form API. Generally, forms are created and worked on using four important functions, namely, getFormId, buildForm, validateForm and submitForm. These definitions are stored in classes.

The basic format will be of the form:

use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; class searchForm extends FormBase { public function getFormId() { return 'search_form'; } public function buildForm(array $form, FormStateInterface $form_state) { //create the form here. return $form; } public function validateForm(array &$form, FormStateInterface $form_state) { // Validate submitted form data. } public function submitForm(array &$form, FormStateInterface $form_state) { // Handle submitted form data. } }

The getFormId() returns the unique id of the form. We need to write the features of the form in the buildForm(). It includes the structure of the form, various fields included and its corresponding types accepted. The validate form is for validating the contents entered into the form which is definitely an important part of any form. Finally, the submitForm() handles the works to be carried out once the user enters the data in the form fields.  This mode of arrangement of the form functionality makes it more standard and properly arranged.

Also, the deprecated functions were removed from the .admin.inc of the module. There were some underscore functions in the Drupal 7 module which supported the configuration and the form settings. These are to be added to the helper file of the module.

These were some of the basic functionalities I could work on and explore. Stay tuned for the future updates on this port process.


Categories:

Vardot: CKEditor Anchor Link

Planet Drupal - Wed, 2016/07/27 - 10:20am
Resources Read time: 3 minutes

We all are excited about Drupal 8 - there are many articles explaining why we shouldn’t be afraid to migrate to it. Briefly speaking, D8 is more mobile-friendly, multilingual, robust, and makes it easier to edit content by including several must-have modules to the core. However, since the new Drupal version was released not a long time ago, there are still many things left in the CMS that require from developers more effort when using Drupal 8. Some of the CKEditor plugins like CKEditor's AutoGrow will be integrated into D8 in the nearest future, but some plugins still have no integration or at least a plan of integration.

Working on the last project with our Drupal team at Vardot I’ve realized that there is a basic feature in D7’s CKEditor that is missing in D8, that is: Anchor Link. Basically this is the background of how the new module was created.

 

CKEditor Anchor Link

CKEditor Anchor Link allows content editors to insert links and anchors using multiple protocols. The possibility to link content was integrated to the core of Drupal 8, however as we can see from the screenshot it didn’t provide users the option to create flags within the document they are editing.

 

 

The ability to jump from one part of the page to another was critical for our client, and in Drupal 8 we had to go an extra mile and code it instead of just installing a module like in D7. CKEditor Anchor Link solves this problem and adds the new icon just in a few minutes. Moreover, it adds to the standard link icons their alternatives that provide site editors with more options of setting up the URL.

 

 

Installing CKEditor Anchor Link on Drupal 8

Below you can find a quick guide of how to install this module:

  1. Download CKEditor Anchor Link from drupal.org

  2. Enable the CKEditor Anchor module.

  3. Go to Configuration -> Text formats and editors.

  4. Select which text format you want to add the anchor button to. For example “Basic HTML”.

  5. Add the Link, Unlink, and Anchor, which came from CKEditor Anchor Link module.

 

  1. Manually remove default link and unlink command buttons and add the new link and unlink, which came with CKEditor Anchor Link.

  2. Save the settings for the for the  “Basic HTML” text format.

  3. Try to add new content, for example Basic page or Blog post, then in the body select the “Basic HTML” text format, then you should see the flag icon in the CKEditor tool.

 

Usage statistics for CKEditor Anchor Link 

The module is pretty new, and the number of users is not very big yet. The good thing however is that it's constantly growing and promises to reach a good level in the future (this blog post is to increase the visibility of CKEditor Anchor Link Module).

 

 

Bottom line

For many editors the ability to quickly jump within the page they are editing (link, unlink, and flag it) is one of the top editing priorities. Since the goal of Vardot distributions Varbase and Uber Publisher is to make Drupal as more editor-friendly as possible, CKEditor Anchor Link seems to be an important addition to our products. If you find this module valuable, please feel free to install it, share this article with others and of course provide me your feedback about the module.

Tags:  drupal 8 Drupal Planet Modules Title:  CKEditor Anchor Link
Categories:

Drupal core announcements: Highlights of issues you can still help with for Drupal 8.2.0-beta1

Planet Drupal - Tue, 2016/07/26 - 11:19pm

There is about a week left before Drupal 8.2 goes into beta! That means we will switch to figuring out any issues with changes in the new version instead of making new changes. For core development that means new features and API additions will move up to 8.3. I asked initiative leaders of both proposed and active initiatives for key things that could use help in the remaining time.

API-first initiative

Allowing user registrations via the REST API only needs some more tests for which examples can be found elsewhere in core. Also, although it may sound a bit scary, REST requests without X-CSRF-Token header: unhelpful response significantly hinders DX, should receive a 401 response is actually a nice approachable novice issue to get involved with.

Ongoing, check out the proposed initiative roadmap and attend the API-first meetings every third Monday of every month 5pm GMT at in Google Hangouts.

Media initiative

An amazing feature is in the works to Improve the UX of Quick Editing images and could use some frontend reviews. Help is also welcome to get HTML 5 video and audio playback functionality directly from file field formatters as well as to get camera capture functionality on image fields.

Larger media management goals in core are still to be defined. The team is meeting on that on July 27th. Follow @DrupalMedia on Twitter. Public meeting times are 2pm UTC every Wednesday on #drupal-media on IRC.

Migrate initiative

Help on any of the issues tagged Migrate critical are welcome, especially Refactoring EntityFile to use process plugins instead which blocks several other issues.

Ongoing, check out the list of issues categorized in migrate's master spreadsheet, and follow @MigrateDrupal on Twitter. Public meeting times are alternating 1pm GMT Thursday and 1am GMT Friday every other week on Google Hangouts.

Workflow initiative

Content moderation module is proposed for core based on the existing improvements achieved by the initiative to expand revision handling for content. Helping with unblocking that issue is very welcome.

Other top issues are Allow removing a module's content entities prior to module uninstallation, Add archived base field to revisionable entities, and Upgrade path between revisionable / non-revisionable entities.

Ongoing, check out the high-level roadmap at https://www.drupal.org/node/2721129, and follow @drupaldeploy on Twitter. Public meeting times to be defined.

For a complete list of meeting times and places (links to Google Hangouts where needed), see the Drupal 8 core calendar.

Categories:

InternetDevels: Drupal Composer template and Phing as Drupal developer tools

Planet Drupal - Tue, 2016/07/26 - 3:05pm

A detailed blog post by our Drupal developer about using
Drupal Composer template and Phing. It is written from
the point of view of the latest Drupal version — Drupal 8.

Read more
Categories:

Mediacurrent: How to Convince your Client Slideshows are Bad

Planet Drupal - Tue, 2016/07/26 - 2:53pm

In my previous blog post, I talked about six design alternatives to avoid slideshows. The response to that blog post was great - who knew there were so many kindred spirits who dislike slideshows? From the feedback I received, the number one question was why are slideshows so bad in the first place? Hopefully this companion blog post will give you that deeper understanding of some reasons not to use a slideshow and maybe help convince your next client that slideshows are a thing of the past.

Categories:

OSTraining: Access Readme Files in Drupal 8

Planet Drupal - Tue, 2016/07/26 - 12:42pm

In this tutorial we will add a module that makes site maintainers' lives easier.

With Drupal 8 setups you are encouraged to use composer, DrupalConsole and Drush because this is a faster and more effective way of adding components to your site. However, you can't access the readme file directly to read information about the module.

We will show you how to use the README module to access readme files directly from the Drupal 8 admin area.

Categories:

Arpit Jalan: GSOC 2016- Developing tests for Image Properties feature of Google Vision module- Week 8

Planet Drupal - Tue, 2016/07/26 - 11:59am
TL;DR In the past two weeks I had worked on using the Image Properties feature offered by the Google Cloud Vision API to group the image files together on the basis of the dominant color components filling them. In addition, I had also worked on detecting the image files and filling the Alternate Text field based on the results of Label/Landmark/Logo/Optical Character Detection, based on the demand of the end user. This week, I have worked on and developed tests to ensure that the similar images are grouped in accordance to the Image Properties feature of the Vision API.

At present, the Google Vision API module supports the Label Detection feature to be used as taxonomy terms, the Safe Search Detection feature to avoid displaying any explicit contents or violence and the User Emotion detection to detect the emotions of the users in their profile pictures and notify them about it.

I had worked on grouping the images on the basis of the dominant color component(Red, Green or Blue) which they are comprised of. I got the code reviewed by my mentors, and they approved it with minor suggestions on injecting the constructors wherever possible.Following their suggestions, I injected the Connection object instead of accessing the database via \Drupal::database().

After making changes as per the suggestions, I started developing simple web tests for this feature, to ensure that the similar images gets displayed under the SImilarContents tab. It requires the creation of new taxonomy vocabulary and adding an entity reference field to the image file entity. After the creation of the new Vocabulary and addition of the new field to the image file, I created the image files using the images available in the simpletests. The images can be accessed through drupalGetTestFiles(). The first test ensures that if the Vocabulary named ‘Dominant Color’ is selected, the similar images gets displayed under the file/{file_id}/similarcontent link.

The grouping, however, requires call to the Google Cloud Vision API, thus inducing dependency on the API key. To remove the dependency, I mocked the function in the test module, returning the custom data to implement the grouping.

To cover the negative aspect, i.e. the case when the Dominant Color option is not selected, I have developed another test which creates a demo vocabulary to simply store the labels, instead of the dominant color component. In this case, the file/{file_id}/similarcontent link displays the message “No items found”.
I have posted the patch covering the suggestions and tests on the issue queue to be reviewed by my mentors. Once they review it, I would work on it further, if required.
Categories:

Web Omelette: Drupal 7 ctools content_type plugin with multiple subtypes

Planet Drupal - Tue, 2016/07/26 - 9:05am

The content_type ctools plugin is the most used type of ctools plugin in Drupal 7. It allows us to quickly build complex (and configurable) components that can be used in the Panels interface. They are quick to set up, the easiest start being the definition of the $plugin array and the implementation of the plugin render function in a .inc file. Have you ever wondered though what the $subtype parameter of this render function is and what it serves?

Most of the time our content_type plugins only have one type so the $subtype argument is the same name as the plugin (and file name). However, it's possible to have multiple subtypes that have slight (but critical) differences while sharing common functionalities. Not many people are familiar with that. Intrigued? Let's see how they work.

When content_type plugins are being processed (loaded, prepared for use and cached), ctools asks them whether there are any subtypes it would like to define or they are single. By default the latter is true but in order to define variations we can either populate an array of subtype definitions in the main $plugin array or implement a function with a specific naming convention: module_name_plugin_name_content_type_content_types. This callback then needs to return the plugin information for all the subtypes of this plugin.

But since it's easier to show than explain, let's take a look at an example. Imagine you need a simple content_type plugin that outputs data which depends on a certain ctools context. You can define your plugin as such:

$plugin = array( 'title' => t('My plugin'), 'description' => t('My plugin description'), 'category' => t('My category'), 'required context' => new ctools_context_required(t('Node'), 'node'), );

This is a simple example of a plugin that depends on the Node context. But what if you want it to depend on the Node context OR the current User context? In other words, it should work on the node_view page manager template or the user_view one. Or whatever page these contexts are on but nowhere else.

Instead of required context you could use 'all contexts' => true. But this would then pass in to your render function all the available contexts. And this is neither elegant nor a statement of dependency on one of those two contexts. In other words, it will be available on all page manager pages but maybe won't do anything on most and it's up to the render function to handle extra logic for checking the contexts.

This is where plugin subtypes come to help out. Since your render function does the exact same regardless of context (or very similar), you can have a subtype for each. So let's see how that's done.

First, we simplify the main plugin array:

$plugin = array( 'title' => t('My plugin'), 'description' => t('My plugin description'), 'category' => t('My category'), );

Then we implement the function that returns the subtypes (following this naming convention):

function my_module_my_plugin_content_type_content_types() { return array( 'node' => array( 'title' => 'My plugin for nodes', 'required context' => new ctools_context_required(t('Node'), 'node'), ), 'user' => array( 'title' => 'My plugin for users', 'required context' => new ctools_context_required(t('User'), 'user'), ), ); }

The subtype machine name is the key in the array and the rest is regular plugin definition as we are used to. In our case we define two, each for their respective dependencies. And with this in place we achieve a number of things.

First, we can add the My plugin for nodes content_type plugin whenever the Node context is available and the My plugin for users when the User context is present. They cannot be used in other cases. Second, we ensure that whatever context is passed to the render function is either a Node or a User (nothing else). This can come in really handy when your context is custom and wraps an object that implements a common interface. Third, the $subtype argument to the render function now will be either node or user which is helpful to maybe slightly fork the functionality depending on the subtype.

Clear the caches and give it a go. Let me know how it works out.

Categories:

Talha Paracha: GSoC'16 – Pubkey Encrypt – Week 9 Report

Planet Drupal - Tue, 2016/07/26 - 2:00am

I started the week by testing Field Encrypt module with my project Pubkey Encrypt. So Pubkey Encrypt provides support for encrypting data with users login credentials by generating Encryption Profiles. And Field Encrypt provides support to encrypt field values using any specified Encryption Profile. In this way, both these modules are expected to work together in harmony. I tested much and both the modules seemed to be getting along perfectly fine with each other.

Categories:

Cocomore: Down with scattering loss! Reaching the right people with clever and creative targeting

Planet Drupal - Tue, 2016/07/26 - 12:00am

A very specific target group generally costs more and has by definition a lower reach. But with exact targeting, customers feel understood by brands, which increases the probability of success in marketing. We demonstrate, which campaigns offer creative approaches that only really take off with clever targeting. 

Categories:

Appnovation Technologies: 3 Appnovator Sessions Accepted for DrupalCon Dublin

Planet Drupal - Mon, 2016/07/25 - 7:52pm

DrupalCon Dublin is right around the corner and we're proud to say that 3 sessions submitted by Appnovators have been accepted!

Categories: