Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 5 hours 44 min ago

eiriksm.dev: Set id of CSV migration row based on line number

Sun, 2020/07/05 - 1:49pm

Migrate in core is among my favorite parts of Drupal 8 and 9. The framework is super flexible, and it makes migrating content from any source you can dream up pretty straight forward. Today I want to show a trick that I use when I receive a csv (or Excel file) from clients, where they want all of the contents in it migrated to Drupal. One very simple example would be a list of categories.

Typically the file will come with one term on each line. However, migrate would want us to set an ID for all of the terms, which currently none of the rows have. One solution to this is to place an ID on all of the rows manually with some sort of spreadsheet software, and then point our migration to the new column for its IDs. But since that both involves the words "manual" and "spreadsheet software" it immediately makes me want to find another solution. Is there a way we can set the row id programmatically based on the row number instead? Why, yes, it is!

So, here is a trick I use to set the ID from the line number:

The migration configuration looks something like this:

id: my_module_categories_csv label: My module categories migration_group: my_module source: # We will use a custom source plugin, so we can set the # ID from there. plugin: my_module_categories_csv track_changes: TRUE header_row_count: 1 keys: - id delimiter: ';' # ... And the rest of the file

As stated in the yaml file, we will use a custom source plugin for this. Let's say we have a custom module called "my_module". Inside that module folder, we create a file called Categories Csv.php inside the folder src/Plugin/migrate/source/CategoriesCsv.php. And in that file we put something like this:

<?php namespace Drupal\my_module\Plugin\Migrate\source; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate_source_csv\Plugin\migrate\source\CSV; /** * Source plugin for Categories in csv. * * @MigrateSource( * id = "my_module_categories_csv" * ) */ class CategoriesCsv extends CSV { /** * {@inheritdoc} */ public function prepareRow(Row $row) { // Delta is here the row number. $delta = $this->file->key(); $row->setSourceProperty('id', $delta); return parent::prepareRow($row); } }

In the code above we set the source property of id to the delta (the row number) of the row. Which means you can have a source like this:

Name Category1 Category2 Category3

Instead of this

id;Name 1;Category1 2;Category2 3;Category3

The best part of this is that when your client changes their mind, you can just update the file instead of editing it before updating it. And with editing, I mean "manually" and with "spreadsheet software". Yuck.

To finish this post, here is an animated gif called "spreadsheet software yuck"

Categories:

Vardot: DrupalAudit

Sun, 2020/07/05 - 2:19am
DrupalAudit Type Tool/Template Firas Ghunaim Sun, 07/05/2020 - 03:19

Your comprehensive Drupal website auditing tool is here!

Vardot released the beta-version of DrupalAudit to aid Drupal website owners and developers just before the release of Drupal 9 early June 2020.

Frequent performance audits are essential to guarantee that you benchmark your desired KPIs and website efficiency in alignments of the objectives of your digital strategy.

The tool will assess your Drupal website across the following key areas:

  • Performance
  • SEO
  • Accessibility
  • Best Practices

To use DrupalAudit, follow these 3 simple steps:

  1. Enter your Drupal site’s URL and test the performance across all site aspects.
  2. Find out how your Drupal site is performing in the areas you care about.
  3. Automatically generated tips will guide you on what to do next.
Form Form title Audit Your Drupal Website Performance Solutions by industry Media and Entertainment Healthcare Financial Services High Tech Travel and Tourism Retail Government Higher Education Nonprofits and NGOs Solutions by need Enterprise CMS Drupal Managed Services E-Commerce Knowledge Management On-Site SEO Omnichannel Marketing Automation Social Business Community Related services Web Development Support and Maintenance Drupal Migration and Upgrades DevOps and Engineering Digital Marketing UI/UX Design Digital Strategy Product Varbase Vardoc Marketing Automation Uber Publisher Open Social
Categories:

DrupalEasy: Drupal 8 entity query across (through?) an entity reference field

Sat, 2020/07/04 - 4:09pm

If you write custom Drupal 8 (or 9) modules, then you've probably used the entity QueryInterface - which is accessible from the Drupal::entityQuery() static method. If not, then you're missing out on this incredibly useful tool that allows you to easily query a Drupal site for entities of any kind. 

For example, if you are looking for all nodes of type Movie that have a Release year of 2009, you can do something like this:

$result = \Drupal::entityQuery('node') ->condition('type', 'movie') ->condition('field_release_year', '2009') ->execute();

But what if you want to base the condition on a value of a referenced entity? Maybe you want to find all nodes of type Movie where the director of the movie was born in 1981? Assume nodes of type Movie have an entity reference field to nodes of type Director, where one of the fields on the Director content type was Birth year. It's almost as easy to write an entityQuery condition for this situation as well:

$result = \Drupal::entityQuery('node') ->condition('type', 'movie') ->condition('field_director:entity:node.field_birth_year', '1981') ->execute();

Note the entity:node bit in the second condition - this is what allows you to access fields in the referenced entity.

Categories:

wishdesk.com: Why upgrade to Drupal 9: guide for Drupal 7 website owners

Fri, 2020/07/03 - 5:06pm
Today, we will be discussing why you should upgrade to Drupal 9. A special focus will be on Drupal 7 websites — what’s important for their owners to know.
Categories:

Gábor Hojtsy: Learn about and shape the future of Drupal at DrupalCon Global

Thu, 2020/07/02 - 6:24pm

Drupal 9 was just released last month, and in less than two weeks we get together to celebrate it (again), learn, grow and plan together for the future at DrupalCon Global.

I presented my "State of Drupal 9" talk at various events for over a year now, and while the original direction of questions were about how the transition would work, lately it is more about what else can we expect from Drupal 9 and then Drupal 10. This is a testament and proof to the continuous upgrade path we introduced all the way back in 2017. Now that Drupal 9.0 is out, we can continue to fill the gaps and add new exciting capabilities to Drupal core.

DrupalCon Global will have various exciting events and opportunities to learn about and help shape the future of Drupal 9 and even Drupal 10. Tickets are $249 and get you access to all session content, summits and BoF discussions. As usual, contributions do not require a ticket and will happen all week as well, including a dedicated contribution day on Friday. Here is a sampling of all content elements discussing, planning on and even building the future of Drupal.

Sessions about the future of Drupal
Photo by Austin Distel on Unsplash

First there is the Driesnote of course. Dries will share the result of the Drupal 2020 Product Survey and discuss plans for Drupal 10. There is a followup Q&A session to discuss the keynote and other topics with Dries live.

The Drupal Initiatives Plenary coordinated by yours truly is going to feature various important leaders in our community working on diversity and inclusion, accessibility, events, mentoring, promotion as well as core components like the Claro admin theme and the Olivero frontend theme. This is the best way to get an overview of how Drupal's teams work, what are their plans and challenges. Even better, the plenary session is followed by a BoF where we can continue the discussion in a more interactive form.

In Drupal Core markup in continuous upgrade path Lauri Eskola will dive into why the deprecation process used for PHP and JavaScript code is not workable for HTML and CSS. This informs the direction of where markup is going in Drupal 9 and 10 onwards.

In the Drupal.org Panel the Drupal Association team discusses how key initiatives are supported on Drupal.org including Composer, Automatic Updates and even Merge Requests for Drupal contribution and plans for the future.

Mike Baynton and David Strauss will discuss Automatic updates in action and in depth showing what is possible now and what are the future plans.

There is not one but two sessions about the new proposed frontend theme. In The Olivero theme: Turning a wild idea into a core initiative Mike Herchel and Putra Bonaccorsi discusses the whole history and future plans while in Designing for chaos: The design process behind Olivero will cover the design specifically.

Moshe Weitzman leads a core conversation to take stock of the current command line tools for Drupal and discuss what a more complete core solution would look like in A robust command line tool for all Drupal sites.

In Let’s Make Drupal Core Less Complicated Ted Bowman will propose ways to simplify Drupal core for existing uses and to achieve an easier learning curve.

Finally Drupal 9: New Initiatives for Drupal offers a chance to discuss new initiatives proposed by Dries in the Driesnote. If you are interested to join in either or discuss the plans, this is your opportunity!

Birds of a Feather discussions about the future of Drupal

Attendees with tickets for DrupalCon Global will be able to participate in live discussions about key topics. BoF submission is open, so this list will possibly grow as time goes.

Ofer Shaal leads a discussion titled Standardize Rector rules as part of Drupal core deprecations to make sure the transition from Drupal 9 to 10 will be even easier than Drupal 8 to 9 is.

Submit your Birds of a Feather discussion now.

Contribute to the future of Drupal
Photo by WOCinTech Chat on Flickr

Just like in-person DrupalCons, DrupalCon Global contribution will be free to attend and does not require a ticket. The contribution spaces are especially good to go to if you are interested in the future of Drupal and making a difference.

If you've been to a DrupalCon or a DrupalCamp before, a contribution event usually involves one or more rooms with tables that have signage on them for what they are working on. This is not exactly possible online, however, we devised a system to replicate tables as groups at https://contrib2020.getopensocial.net/all-groups which allows you to see what topics will be covered and who the leads are. (Huge props to Rachel Lawson at the Drupal Association for building this out!)

If your topic is not yet there, you should create a group now. Groups indicate what they are working on and what skills they need from contributors. You should join groups you are interested to help and read their information for guidance. Teams will post group events to let you know when certain activities (introduction, review sessions, co-working on specific problems or meetings to discuss issues) will happen. Events will also be used to signify when you are most likely to find people working on the topics. The OpenSocial site is a directory of topics and events, contribution itself will happen on drupal.org with discussion on Drupal Slack for most groups.

There are already groups for Configuration Management 2.0, the Olivero theme, the Bug Smash initiative and Media. Stay tuned for more appearing as the event comes closer.

Categories:

DrupalCon News: Makers & Builders

Thu, 2020/07/02 - 4:46pm
Categories:

Srijan Technologies: What’s New in Drupal 9 and Why Do You Need To Upgrade

Thu, 2020/07/02 - 3:15pm

Drupal 9 was launched on June 3, 2020. Given this, it would be necessary for enterprises to upgrade to it later or sooner to acquire complete functionality and retain the ability to receive security updates within the bi-yearly cycles.

Categories:

OpenSense Labs: Reasons Why Drupal Is The Best Fit For Your E-Commerce Website

Thu, 2020/07/02 - 2:08pm
Reasons Why Drupal Is The Best Fit For Your E-Commerce Website Tuba Ayyubi Thu, 07/02/2020 - 17:38


Evolving technologies and marketing strategies have changed the way shopping is experienced. With time, the charm and challenges of eCommerce have increased. How do you plan to overcome these challenges?

As an online brand, you have your challenges when eyeing expansion and opportunities. To achieve the right numbers it is important to engage with customers and sell quality products, all through the right platform.

Talking about the right platform, you can always trust Drupal. Drupal is a content management system with hundreds of modules and themes ready to drive your business online. Drupal adds the magic that your website needs.

The State Of Digital Commerce

Drupal provides amazing features for your eCommerce website, but before jumping to that, let’s take a glance at some stats and understand where the eCommerce industry is heading.

According to Statista, online sales reached $2.5 trillion for the global eCommerce market at the end of 2019 and represented 14% of its global market share. The same data says that by the end of 2020, global commerce sales are predicted to reach $4.2 trillion and the representation will increase to 16%.

Source: Statista

The way that people have been shopping online has changed. Keeping up with trends is important for the growth in the retail landscape of 2020. The future looks bright for eCommerce in the coming time.

Personalization is the key if you want to earn the trust of your customers and give them an experience that makes them come back to your website again. Contactless payment has become the shopping trend and has been continuing for a long time. People prefer paying online instead of cash on delivery. So, providing diverse options for payments is important to keep your customers’ experience a happy one. Subscriptions are an ongoing trend that has helped brands get a lot of long term customers. Similarly, Chatbots have been a great help in enhancing the experience of the users. Experts have predicted that 80% of businesses will be using chatbots by the end of 2020. Voice search has become popular with time. 26.1% of consumers have made a purchase on a smart speaker in 2019. 

To leverage all these ongoing trends, and drive sales of your product online, you need a robust and future-ready eCommerce website and Drupal is ready to help!

Why Using Drupal Brings You A Lot Of Benefits

One of the most comprehensive open-source CMSes available, Drupal, is the perfect fit for eCommerce businesses. It gives you the perfect way of modeling your content, integrated marketing, payment, and fulfillment tools, which helps in bringing in a bigger audience. All the features of Drupal are accessible to merchants of every size.

There are so many brands out there using Drupal for their online business. Here are a few of them:

Honda Brazil

The website of Honda Brazil, built using Drupal, gives the users an engaging experience with easily accessible information.


Timex

With the help of Drupal, Timex, a famous American Watchmaker, is able to provide its customers a seamless, engaging, and consistent online experience.


Lush

Lush, with its website powered by Drupal, has seen dramatic spikes in both online and traffic sales.


Puma

Puma, one of the leading sports brands, has its website built on top of Drupal.


Why do such great brands choose Drupal for their online business? Let’s look at the reasons that show why Drupal is the best fit for your eCommerce website:

Commerce Kickstart

It’s a distribution for the quickest way to get up and running with Drupal for eCommerce features. If you are launching an online store, commerce kickstart is a great resource that will get you up and running with the production environment. 

Commerce Kickstart is made for modern PHP lovers and is available only for Drupal 7. The categories in this distribution include shipping and payment providers, data migration, search tools, product catalogs, etc.

Drupal Commerce

Drupal Commerce is a dedicated solution for your eCommerce needs. It is basically a set of modules for Drupal that enable the host of eCommerce features. Drupal Commerce being a framework itself, focuses on the solutions that can be built by using it. In simpler words, Drupal Commerce brings to your website the basic functions like order, product details, cart item, and payment options.

There are many features of Drupal Commerce that are further extended with the help of modules. Here are a few of them:

  • Modules like Commerce Stock and Commerce Inventory make inventory management easy. 
  • Commerce shipping is Drupal commerce contributed module that is used in cases where the shipping address and the billing address is different by making use of the customer profile.
Essential modules for an e-commerce site

There are plenty of Drupal modules that can be added to your eCommerce site and will help you in building intuitive and powerful websites. Here are some of the modules provided by Drupal for eCommerce:

  • Commerce Shipping takes care of the shipping rate calculation system for Drupal Commerce. It is used with the combination of other shipping method modules like Commerce Flat Rate, Commerce UPS, etc.
  • The Currency module helps your website with currency conversion and information and does the work of displaying the price of the product.
  • Commerce Stripe makes sure that the customers can pay securely without having to leave your website.
Essential themes for an e-commerce site

The first thing that attracts a user when they visit your website is the appearance of your website. Drupal provides amazing themes for your eCommerce websites which come in handy.

  • eStore is Bootstrap based and easy to install and is designed in a way that it solves any eCommerce website’s needs.
  • Flexi Cart is a global theme that makes sure that your products sell fast and easily online.
  • Belgrade is a Drupal Commerce template specially designed to create business websites.
  • SShop is among those Drupal 8 themes which are responsible for providing the users with inbuilt support for Drupal Commerce.
Content-Driven Commerce

Content marketing is the most popular way and for sure gets you the best SEO results. A good story behind your brand will definitely drive sales for you. If the content on your website is engaging, the users will keep coming back to your website.

The stories can be anything that relates to your product. For example, if you are selling lipsticks, you can write an article that says which shade is the perfect one for your different colored outfits.

It is really important to decide the kind of content you want to post on your website. Your content can include blog posts, ebooks, guides, tips, hacks, etc.

Drupal covers the need for content-driven experience. No matter what the case may be, content types are at the core of Drupal that include, mobile editing, in-place authoring, easy content authoring, content revisioning and workflows, and modules for multimedia content.

Headless Commerce

Headless Commerce, which acts as a great catalyst to upscale content-driven commerce, gives immense flexibility to create a great shopping experience for the users. It is future-focused and stays relevant. JavaScript interface communicates with backend Drupal via REST API. Also, in Decoupled Drupal, there is a separation between the presentation layer and eCommerce backend.

Headless Drupal commerce comes with a lot of benefits including high speed, interactive features, and freedom in front-end changes. These features provide a great shopping experience to the customers online by providing a content-rich experience.

Read our article on the implementation of Decoupled Drupal Commerce and React Native to learn more about the benefits of a headless commerce approach.

Performance

It is important to take into account the speed of your website. It is seen that a site that loads in five seconds has 70% longer average conversions. A slow website will deter your efforts and investments. 79% of the shoppers who faced the slow- loading issue say that they don’t return to the websites. These bounces bring a direct effect on revenue generation.

To maintain a top-notch web performance, Drupal comes packed with plenty of offerings. Some of them include:

  • Blazy module helps the pages load faster and saves data usage if the user is not using the whole page.
  • CDN module helps with the integration of Content Delivery Network for the websites and mitigate the page load time and rapidly deliver the web page components
  • In case, your server hardware is reaching its limits, Drupal gives you the option to upgrade the server hardware for a faster way of scaling.
Mobile Ready

If your website runs smoothly on mobile devices, it will be able to run better on other devices too! Creating user scenarios will help you understand what kind of content the user will appreciate on their mobile. This approach will help you design the important elements required for your website.

Mobile compatibility has become an irreplaceable feature for any eCommerce site. In today’s world, everything needs to be mobile-ready. Drupal’s websites not only wow the clients by their looks but also by their mobile responsive design. Drupal websites are easily accessible on mobile and tablets.

Multilingual

The world is on the internet, and with so many people using similar platforms and so many brands expanding globally, multilingual websites are the sine qua non! 

China has the highest number of internet users which is a massive 772 million. Although the maximum number of people on the internet prefer English as their language, 10 other languages that account for 90% of the top 10 million websites.

Source: Internet World Stats

Drupal is the best choice for your multilingual website. It provides numerous languages to choose from and 4 core modules specially designed for language and translation support. This feature by Drupal has shown great results that include higher conversions, rise in SEO, unrivaled translation workflows and has also been a great help in widening the audience. It also allows the detection of the user’s preferred language by identifying users’ IP address, sessions, browser settings, etc.

Personalization

Every eCommerce brand wants to make sure that the content created by them leaves a mark on the users’ minds. And it has become a necessity today because there is a lot of competition out there. Hence, personalized content makes the user experience better and helps create trust between you and the customer.

According to an Adobe report on personalization, 92% of the B2B marketers say that personalization is important.

This is the marketing opportunity that no eCommerce business should miss out on. Tapping the different demographics and varied audiences not only improves your market reach but your bottom line as well. 

Following are examples of modules that can aid your web personalization efforts:

  • The Smart Content module gives real-time anonymous personalization for the users. It also allows the site administrators to display different content for anonymous users based on browser conditions
  • Acquia Lift Connector module helps organizations in delivering personalized content and experience across all platforms and devices by merging content and customer data into one tool. 
SEO

E-commerce websites are buried with huge data. While for a consumer, it might be a desirable situation, for a marketeer it increases the burden of implementing SEO on every page and indexing every product. 

Drupal has various modules that help in improving the SEO of your eCommerce website. Some of them are:

  • Pathauto is an SEO module that ensures that the URL of your website is search engine friendly. It converts complex URLs to simpler ones.
  • Metatag module is a multilingual module and controls all the metatags on all the web pages.
  • XML Sitemap module provides you the resilience to exclude or include a few pages on your Sitemap.
Security

With the increase in cases of hacking and security breaches, basic security do-it-yourselves are not sufficient. The security breaches affect your brand image and your market shares and stock price. According to a report, more than $3.5 Billion was lost to Cyber Crime in 2019. 

Drupal has a dedicated team that regularly works on the security side of it. It is frequently tested for issues and bugs. Drupal also provides various security modules for your eCommerce website. Some of them are:

  • The Password policy module provides the password policies that help users to create a strong password. The password entered by the user is not accepted until it meets the constraints set by this module. 
  • Security Kit module provides various security- hardening options. This helps in reducing different risks coming from different web applications.
  • Two-factor authentication module is a second step for your security check, where a set of codes is defined for a user to be able to sign in. 

If you open a webpage from your mobile device and at the same time open it on your PC/laptop, you will be forced to close one of the pages. The session limit module does the same work of limiting the number of sessions by a user at the same time.

To Sum Up

The substantial development in the concept of ‘eCommerce’ has kept the online brands on their toes. And this is where Drupal provides its unmatched services for your eCommerce platform. 

Be it building your eCommerce website or migrating to Drupal, we at OpenSense Labs will help you do your job smoothly until you get a desirable finish.

Feel free to contact us at hello@opensenselabs.com to drive sales on your website!

blog banner blog image Drupal Ecommerce website Ecommerce Drupal websites Drupal Commerce Blog Type Articles Is it a good read ? On
Categories:

Agaric Collective: Drupal migrations reference: List of configuration options in YAML definition files

Thu, 2020/07/02 - 2:00pm

In today’s article we are going to provide a reference of all configuration options that can be set in migration definition files. Additional configuration options available for migrations defined as configuration will also be listed. Finally, we present the configuration options for migrations groups.

General configuration keys

The following keys can be set for any Drupal migration.

id key

A required string value. It serves as the identifier for the migration. The value should be a machine name. That is, lowercase letters with underscores instead of spaces. The value is for creating mapping and messages tables. For example, if the id is ud_migrations, the Migrate API will create the following migrations migrate_map_ud_migrations and migrate_message_ud_migrations.

label key

A string value. The human-readable label for the migration. The value is used in different interfaces to refer to the migration.

audit key

A boolean value. Defaults to FALSE. It indicates whether the migration is auditable. When set to TRUE, a warning is displayed if entities might be overridden when the migration is executed. For example, when doing an upgrade from a previous version of Drupal, nodes created in the new site before running the automatic upgrade process would be overridden and a warning is logged. The Migrate API checks if the highest destination ID is greater than the highest source ID.

migration_tags key

An array value. It can be set to an optional list of strings representing the tags associated with the migration. They are used by the plugin manager for filtering. For example, you can import or rollback all migrations with the Content tag using the following Drush commands provided by the Migrate Tools module:

$ drush migrate:import --tag='Content' $ drush migrate:rollback --tag='Content'source key

A nested array value. This represents the configuration of the source plugin. At a minimum, it contains an id key which indicates which source plugin to use for the migration. Possible values include embedded_data for hardcoded data; csv for CSV files; url for JSON feeds, XML files, and Google Sheets; spreadsheet for Microsoft Excel and LibreOffice Calc files; and many more. Each plugin is configured differently. Refer to our list of configuration options for source plugins to find out what is available for each of them. Additionally, in this section you can define source contents that can be later used in the process pipeline.

process key

A nested array value. This represents the configuration of how source data will be processed and transformed to match the expected destination structure. This section contains a list of entity properties (e.g. nid for a node) and fields (e.g. field_image in the default article content type). Refer to our list of properties for content entities including Commerce related entities to find out which properties can be set depending on your destination (e.g. nodes, users, taxonomy terms, files and images, paragraphs, etc.). For field mappings, you use the machine name of the field as configured in the entity bundle. Some fields have complex structures so you migrate data into specific subfields. Refer to our list of subfields per field type to determine which options are available. When migrating multivalue fields, you might need to set deltas as well. Additionally, you can have pseudofields to store temporary values within the process pipeline.

For each entity property, field, or pseudofield, you can use one or more process plugins to manipulate the data. Many of them are provided by Drupal core while others become available when contributed modules are installed on the site like Migrate Plus and Migrate Process Extra. Throughout the 31 days of migrations series, we provided examples of how many process plugins are used. Most of the work for migrations will be devoted to configuring the right mappings in the process section. Make sure to check our debugging tips in case some values are not migrated properly.

destination key

A nested array value. This represents the configuration of the destination plugin. At a minimum, it contains an id key which indicates which destination plugin to use for the migration. Possible values include entity:node for nodes, entity:user for users, entity:taxonomy_term for taxonomy terms, entity:file for files and images, entity_reference_revisions:paragraph for paragraphs, and many more. Each plugin is configured differently. Refer to our list of configuration options for destination plugins to find out what is available for each of them.

This is an example migration from the ud_migrations_csv_source module used in the article on CSV sources.

id: udm_csv_source_paragraph label: 'UD dependee paragraph migration for CSV source example' migration_tags: - UD CSV Source - UD Example source: plugin: csv path: modules/custom/ud_migrations/ud_migrations_csv_source/sources/udm_book_paragraph.csv ids: [book_id] header_offset: null fields: - name: book_id - name: book_title - name: 'Book author' process: field_ud_book_paragraph_title: book_title field_ud_book_paragraph_author: 'Book author' destination: plugin: 'entity_reference_revisions:paragraph' default_bundle: ud_book_paragraphmigration_dependencies key

A nested array value. The value is used by the Migrate API to make sure the listed migrations are executed in advance of the current one. For example, a node migration might require users to be imported first so you can specify who is the author of the node. Also, it is possible to list optional migrations so that they are only executed in case they are present. The following example from the d7_node.yml migration shows how key can be configured:

migration_dependencies: required: - d7_user - d7_node_type optional: - d7_field_instance - d7_comment_field_instance

To configure the migration dependencies you specify required and optional subkeys whose values are an array of migration IDs. If no dependencies are needed, you can omit this key. Alternatively, you can set either required or optional dependencies without having to specify both keys. As of Drupal 8.8 an InvalidPluginDefinitionException will be thrown if the migration_dependencies key is incorrectly formatted.

class key

A string value. If set, it should point to the class used as the migration plugin. The MigrationPluginManager sets this key to \Drupal\migrate\Plugin\Migration by default. Whatever class specified here should implement the MigrationInterface. This configuration key rarely needs to be set as the default value can be used most of the time. In Drupal core there are few cases where a different class is used as the migration plugin:

deriver key

A string value. If set, it should point to the class used as a plugin deriver for this migration. This is an advanced topic that will be covered in a future entry. In short, it is a mechanism in which new migration plugins can be created dynamically from a base template. For example, the d7_node.yml migration uses the D7NodeDeriver to create one node migration per content type during a Drupal upgrade operation. In this case, the configuration key is set to Drupal\node\Plugin\migrate\D7NodeDeriver. There are many other derivers used by the Migrate API including D7NodeDeriver, D7TaxonomyTermDeriver, EntityReferenceTranslationDeriver, D6NodeDeriver, and D6TermNodeDeriver.

field_plugin_method key

A string value. This key must be set only in migrations that use Drupal\migrate_drupal\Plugin\migrate\FieldMigration as the plugin class. They take care of importing fields from previous versions of Drupal. The following is a list of possible values:

  • alterFieldMigration as set by d7_field.yml.
  • alterFieldFormatterMigration as set by d7_field_formatter_settings.yml.
  • alterFieldInstanceMigration as set by d7_field_instance.yml.
  • alterFieldWidgetMigration as set by d7_field_instance_widget_settings.yml

There are Drupal 6 counterparts for these migrations. Note that the field_plugin_method key is a replacement for the deprecated cck_plugin_method key.

provider key

An array value. If set, it should contain a list of module machine names that must be enabled for this migration to work. Refer to the d7_entity_reference_translation.yml and d6_entity_reference_translation.yml migrations for examples of possible values. This key rarely needs to be set. Usually the same module providing the migration definition file is the only one needed for the migration to work.

Deriver specific configuration keys

It is possible that some derivers require extra configuration keys to be set. For example, the EntityReferenceTranslationDeriver the target_types to be set. Refer to the d7_entity_reference_translation.yml and d6_entity_reference_translation.yml migrations for examples of possible values. These migrations are also interesting because the source, process, and destination keys are not configured in the YAML definition files. They are actually set dynamically by the deriver.

Migration configuration entity keys

The following keys should be used only if the migration is created as a configuration entity using the Migrate Plus module. Only the migration_group key is specific to migrations as configuration entities. All other keys apply for any configuration entity in Drupal. Refer to the ConfigEntityBase abstract class for more details on how they are used.

migration_group key

A string value. If set, it should correspond to the id key of a migration group configuration entity. This allows inheriting configuration values from the group. For example, the database connection for the source configuration. Refer to this article for more information on sharing configuration using migration groups. They can be used to import or rollback all migrations within a group using the following Drush commands provided by the Migrate Tools module:

$ drush migrate:import --group='udm_config_group_json_source' $ drush migrate:rollback --group='udm_config_group_json_source'uuid key

A string value. The value should be a UUID v4. If not set, the configuration management system will create a UUID on the fly and assign it to the migration entity. Refer to this article for more details on setting UUIDs for migrations defined as configuration entities.

langcode key

A string value. The language code of the entity's default language. English is assumed by default. For example: en.

status key

A boolean value. The enabled/disabled status of the configuration entity. For example: true.

dependencies key

A nested array value. Configuration entities can declare dependencies on modules, themes, content entities, and other configuration entities. These dependencies can be recalculated on save operations or enforced. Refer to the ConfigDependencyManager class’ documentation for details on how to configure this key. One practical use of this key is to automatically remove the migration (configuration entity) when the module that defined it is uninstalled. To accomplish this, you need to set an enforced module dependency on the same module that provides the migration. This is explained in the article on defining Drupal migrations as configuration entities. For reference, below is a code snippet from that article showing how to configure this key:

uuid: b744190e-3a48-45c7-97a4-093099ba0547 id: udm_config_json_source_node_local label: 'UD migrations configuration example' dependencies: enforced: module: - ud_migrations_config_json_sourceMigration group configuration entity keys

Migration groups are also configuration entities. That means that they can have uuid, langcode, status, and dependencies keys as explained before. Additionally, the following keys can be set. These other keys can be set for migration groups:

id key

A required string value. It serves as the identifier for the migration group. The value should be a machine name.

label key

A string value. The human-readable label for the migration group.

description key

A string value. More information about the group.

source_type key

A string value. Short description of the type of source. For example: "Drupal 7" or "JSON source".

module key

A string value. The machine name of a dependent module. This key rarely needs to be set. A configuration entity is always dependent on its provider, the module defining the migration group.

shared_configuration key

A nested array value. Any configuration key for a migration can be set under this key. Those values will be inherited by any migration associated with the current group. Refer to this article for more information on sharing configuration using migration groups. The following is an example from the ud_migrations_config_group_json_source module from the article on executing migrations from the Drupal interface.

uuid: 78925705-a799-4749-99c9-a1725fb54def id: udm_config_group_json_source label: 'UD Config Group (JSON source)' description: 'A container for migrations about individuals and their favorite books. Learn more at https://understanddrupal.com/migrations.' source_type: 'JSON resource' shared_configuration: dependencies: enforced: module: - ud_migrations_config_group_json_source migration_tags: - UD Config Group (JSON Source) - UD Example source: plugin: url data_fetcher_plugin: file data_parser_plugin: json urls: - modules/custom/ud_migrations/ud_migrations_config_group_json_source/sources/udm_data.json

What did you learn in today’s article? Did you know there were so many configuration options for migration definition files? Were you aware that some keys apply only when migrations are defined as configuration entities? Have you used migrations groups to share configuration across migrations? Share your answers in the comments. Also, I would be grateful if you shared this blog post with friends and colleagues.

Read more and discuss at agaric.coop.

Categories:

Electric Citizen: Introducing DrupalCon Global

Thu, 2020/07/02 - 11:07am

DrupalCon North America is an annual tradition, where thousands of people come together in a great American city for a week-long conference of learning, networking and socializing.

Things are different this year, for obvious reasons. But DrupalCon lives on in DrupalCon Global! This is the first-ever virtual edition of DrupalCon. Running from July 14-17, 2020, this online-only conference is open to anyone and everyone, worldwide. If you haven’t done so, consider registering today!

Categories:

Kristof De Jaeger: Indigenous for iOS, IndieWeb and ActivityPub for Drupal

Thu, 2020/07/02 - 9:08am

I'm glad to announce that I've been awarded a grant as part of the European Next Generation Internet initiative (NGI) by the Dutch NLnet Foundation to work on my (currently) favorite projects: Indigenous and IndieWeb1. I didn't count on being selected when I submitted my proposal when looking at the other entries, but I guess I made a good case. I'll be spending a lot of time the following months working on them, so you can expect some exciting releases. The status of all projects and work done within this grant will be tracked here.

Indigenous for iOS

The app was originally started by Edward Hinkle and was the main trigger for me to build the Android equivalent. The project is currently unmaintained and lacks many features which are available in the Android version. Thanks to the grant, I can now revive the project so iOS users will be able to enjoy IndieWeb with a more richer and mature application.

Edward was so kind to transfer the existing repository over to me so all issues are preserved. I'll be creating projects and milestones so everyone can track progress. At some point, I will start rolling out releases in a beta program, so watch this space or announcements on Twitter to know when you can sign up for testing.

Multiple user support for the Drupal IndieWeb module

One of the last major missing pieces for the module is support for multiple users. All features currently work great for one account and the Micropub server supports multiple authors posting to the same domain. However, it's far from perfect, and especially the built-in Microsub server is not compatible at all for more than one user.

Work started in a separate branch a couple of months ago, but progress is slow as dragons are everywhere and I only work on this when I have some free time. With this grant, I'll be able to focus 2 weeks in a row to rewrite the critical pieces, not to mention all the tests.

I haven't decided yet whether I'm going to write an upgrade path, but I will keep on supporting both branches as I'm using the module on my site which only has one user, so no need to worry in case you are using the module already.

Kickstarting ActivityPub module for Drupal

It's been on my mind for so long, but I will finally will be able to work extensively on the Drupal Activity module. My work will happen on Drupal.org instead of the existing repository on GitHub, which will be used for a more extended version somewhere in the future. The 1.0.x branch on d.o will contain the lite version.

Open Web

Besides these 3 major goals, I'll focus as well on the interoperability of both app clients (Android and iOS) with more software, e.g. Mastodon and Pixelfed. I'm brainstorming to figure out the best approach to contribute and how to integrate them with both clients, more details will be released in future blog posts and notes.

All those projects have a place in my personal vision on the Open Web, so I feel incredibly lucky to be able to work on them almost full time, hoping to convince more people to jump onboard ultimately. It would be great if we could get something into Drupal Core one day, or at least make some more noise around it. If you have questions, feedback or just want to have a chat, I'm (still, yes I know) on IRC on irc.freenode.net (indieweb or drupal channels). Ping swentel and I'll be all ears.

Footnotes

1. to be fair, Solfidola might come close to become my new favorite, but it's not related with IndieWeb at all :)

Categories:

DrupalCon News: Plenary Speakers Announced For Drupalcon Global Open Source Digital Experience Conference

Thu, 2020/07/02 - 6:00am

Mitchell Baker and Dries Buytaert join a diverse lineup of speakers at annual conference 
encouraging attendees to “Be Human, Think Digital”
https://drupal.org

Categories:

Agaric Collective: Free Drupal 9 webinars on site building, migrations, and upgrades

Wed, 2020/07/01 - 9:00pm

On Tuesday, July 7, Agaric will host 3 free online webinars about Drupal 9. We invite the community to join us to learn more about the latest version of our favorite CMS. We will leave time at the end of each presentation for questions from the audience. All webinars will be presented online via Zoom. Fill out the form at the end of the post to reserve your seat. We look forward to seeing you.

Getting started Drupal 9

Time: 10:00 AM - 11:00 AM Eastern Time (EDT)

This webinar will cover basic site building concepts. You will learn what is a node and how they differ from content types. We are going to explain why fields are so useful for structuring your site's content and the benefits of doing this. We will cover how to use Views to create listing of content. Layout builder, blocks, taxonomies, and the user permissions system will also be explained.

Introduction to Drupal 9 migrations

Time: 11:30 AM - 12:30 AM Eastern Time (EDT)

This webinar will present an overview of the Drupal migrations system. You will learn about how the Migrate API works and what assumptions it makes. We will explain the syntax to write migrations how different source, process, and destinations plugins work. Recommended migration workflows and debugging tips will also be presented. No previous experience with the Migrate API nor PHP is required to attend.

Drupal 9 upgrades: how and when to move your Drupal 7 sites?

Time: 1:00 PM - 2:00 PM Eastern Time (EDT)

This webinar will present different tools and workflows to upgrade your Drupal 7 site to Drupal 9. We will run through what things to consider when planning an upgrade. This will include how to make site architecture changes, modules that do not have D9 counterparts, what to do when there are no automated upgrade paths.

Agaric is also offering full-day trainings for these topics later this month. Dates, prices, and registration options is available at https://agaric.coop/training

Read more and discuss at agaric.coop.

Categories:

Drudesk: Upgrade your website from Drupal 7 to 8/9 with the Drupal Module Upgrader

Wed, 2020/07/01 - 6:41pm

The idea to upgrade a website from Drupal 7 to Drupal 8/9 is getting new perspectives.

Now that Drupal 9 is there as an official release, it’s clear like never before that Drupal 7 is getting outdated. It’s time to upgrade Drupal 7 sites so they can give their owners a much better value. The Drudesk support team knows how to achieve this through upgrades and updates, as well as speed optimization, bug fixes, redesign, and so on.

Categories:

OpenLucius: Update OpenLucius | Create your own social network with 'Posts' (and 3 other new features)

Wed, 2020/07/01 - 5:48pm

We collected user feedback from which new functions were built, we also improved existing features and design. 4 highlights:

1. Social network posts

You can now use Lucius as a social network, instantly: let everybody place Posts to share what is happening and create interaction with inline comments and likes. 

Build community and culture out-of-the-box:

Categories:

Tag1 Consulting: Enabling Declarative Components Everywhere: Drupal + Web Components Out of the Box

Wed, 2020/07/01 - 2:13pm

Many front-end technologies, especially React, now consider the notion of declarative components to be table stakes. Why haven't they arrived in environments like the Drupal CMS's own front end? Many native CMS presentation layers tend to obsolesce quickly and present a scattered or suboptimal developer experience, particularly against the backdrop of today's rapidly evolving front-end development workflows. But according to Fabian Franz, there is a solution that allows for that pleasant front-end developer experience within Drupal itself without jettisoning Drupal as a rendering layer. The solution is a combination of Web Components support within Drupal and intelligent handling of immutable state in data that allows for Drupal to become a more JavaScript-like rendering layer. Rather than working with endless render trees and an antiquated Ajax framework, and instead of reinventing Drupal's front-end wheel from scratch, Fabian recommends adopting the best of both worlds by incorporating key aspects of Web Components, the Shadow DOM, and particularly syntactic sugar for declarative components that competes readily not only with wildly popular JavaScript technologies like React and Vue but also matches up to the emerging approaches seen in ecosystems like Laravel. In this Tag1 Team Talks episode, join Fabian Franz (Senior Technical Architect and...

Read more preston Wed, 07/01/2020 - 05:13
Categories:

Kristen Pol: Upgrading your site to Drupal 9? Check out these DrupalCon Global sessions!

Wed, 2020/07/01 - 2:05am


Image credit: Aaron Deutsch

DrupalCon Global 2020 is in a couple weeks and there are a lot of amazing sessions. Hope you can make it! While preparing my own DrupalCon Global session, I reviewed the other sessions and made a list of ones you might want to watch to help you prepare for upgrading from Drupal 6 or 7 or 8 to Drupal 9.

In some cases, it was very hard to choose just one on a particular topic. For example, there are 3 great layout builder talks! So, while these are some of my top picks, don't forget to check out all the DrupalCon Global sessions and add your favorites to your schedule.

If you are upgrading from Drupal 8 to Drupal 9 and don't need to make any website improvements, then you can focus on the Drupal 9 sessions. If you will be doing a redesign and/or upgrading from Drupal 6 or 7 to Drupal 9, check sessions for dreaming up your new site, planning your new site architecture, and implementing your new site.

read more

Categories:

Promet Source: Usability Test Drives Decisions for University Website

Tue, 2020/06/30 - 10:31pm
When Lehigh University set out to redo its website for prospective undergraduates, one overriding factor was crystal clear to the staff members and stakeholders who were making the key decisions concerning the site. The cohort of digital natives to whom the website needed to appeal, was likely to have different ideas about web navigation and the kinds of site structures that make the most sense. 
Categories:

Lullabot: Continuous Deployment, Infrastructure as Code, and Drupal: Part 1

Tue, 2020/06/30 - 6:12pm

Having devoured DevOps books for the past year and a half, it was interesting to find that some of them contained the terms Infrastructure as Code and Continuous Deployment. It was amazing to learn from the DevOps Handbook that companies were already doing these things in the early 2000s.

Categories: