Development News

WordPress 5.8 Beta 3

Wordpress News - 8 hours 55 min ago

WordPress 5.8 Beta 3 is now available for testing!

This software is still in development, so it is not recommended to run this version on a production site. Consider setting up a test site to play with it.

You can test the WordPress 5.8 Beta 3 in three ways:

  • Install/activate the WordPress Beta Tester plugin (select the Bleeding edge channel and the Beta/RC Only stream).
  • Direct download the beta version here (zip).
  • Using WP-CLI to test: wp core update --version=5.8-beta3

The current target for the final release is July 20, 2021. That’s just four weeks away, so we need your help to make the final release is as good as it can be.

Some Highlights

Since Beta 2, 38 bugs have been fixed. Here is a summary of some of the included changes:

  • Block Editor: Move caching to endpoint for unique responses. (#53435)
  • Bundled Themes: Improve display of blocks in widget areas. (#53422)
  • Coding Standards: Bring some consistency to HTML formatting in wp-admin/comment.php. (#52627)
  • Editor: Include Cover block in the list of block types registered using metadata files. (#53440)
  • Editor: Include Cover block in the list of block types registered using metadata files. (#53440)
  • Media: Add new functions to return the previous/next attachment links. (#45708)
  • Media: Improve upload page media item layout on smaller screens. (#51754)
  • Media: Update total attachment count when media added or removed. (#53171)
  • REST API: Decode single and double quote entities in widget names and descriptions. (#53407)
  • Twenty Nineteen: Update margins on full- and wide-aligned blocks in the editor. (#53428)
  • Widgets: Add editor styles to the widgets block editor. (#53344)
How You Can Help

Watch the Make WordPress Core blog for 5.8-related developer notes in the coming weeks, which will break down these and other changes in greater detail.

So far, contributors have fixed 254 tickets in WordPress 5.8, including 91 new features and enhancements, and more bug fixes are on the way.

Do some testing!

Testing for bugs is a vital part of polishing the release during the beta stage and a great way to contribute.

If you think you’ve found a bug, please post to the Alpha/Beta area in the support forums. We would love to hear from you! If you’re comfortable writing a reproducible bug report, file one on WordPress Trac. That’s also where you can find a list of known bugs.

Props to @jeffpaul @desrosj @hellofromtonya @pbiron for reviews and final edits!

Esperanza first.
Want to know the next jazzer?
Then please test beta.

Aten Design Group: Programmatically copy field data in Drupal 8

Main Drupal Feed - Tue, 06/22/2021 - 15:54
Programmatically copy field data in Drupal 8 John Ferris Tue, 06/22/2021 - 09:54 Drupal Drupal 8 Code

The code to programmatically copy field data in Drupal 8 is pretty simple, but I wasn’t able to find any great examples for performing the operation at scale when I ran into the need myself. Hopefully the code sample below helps somebody save a few minutes of digging for solutions.

My use case was straightforward: After more than a year of continual development on a client site, new patterns emerged in how content editors utilized certain entity reference fields. It became apparent that similar relationships across different content types used separate fields with different machine names. This made it tricky to aggregate and filter content. It also led to overly complex implementations of any custom functionality based on these relationships. One thing was clear: we needed the fields to be consistent across content types.

Basically, I needed entity references stored in various older fields, let’s say field_old_one and field_old_two, to be copied into a single destination field we’ll call field_new.

Once I’d added our field_new field to all the appropriate content types via the field UI, I needed to migrate the references out of the old fields, and into the new fields. What’s the best way to do this when manual GUI changes would take too long? A hook_post_update_NAME implementation was my answer.

The code to programmatically copy field data in Drupal 8 isn’t the hard part. Assuming your source and destination field types are compatible, it’s just two quick lines:

/* @var $node \Drupal\node\NodeInterface $node */ $node->$dest_field = $node->$source_field; $node->save();

It gets complicated when you need to do this on hundreds or thousands of entities. We don’t want to load, process, and save all those entities at once as that would likely bring our server down. We need to batch the operation. Implementations of hook_post_update_NAME act as implementations of callback_batch_operation — allowing us to execute a custom callback _my_module_copy_field_values across multiple HTTP requests and avoid PHP timeouts. First, we define that callback.

/** * Copies the value from one field to another empty field. * * @param array $sandbox * The batch operation sandbox. * @param string $bundle * The node bundle. * @param string $source_field * The source field name. * @param string $dest_field * The destination field. * @param int $nodes_per_batch * The amount of nodes to update at a given time. */ function _my_module_copy_field_values(array &$sandbox, $bundle, $source_field, $dest_field, $nodes_per_batch = 20) { $storage = \Drupal::entityTypeManager()->getStorage('node'); // Initialize some variables during the first pass through. if (!isset($sandbox['total'])) { $query = $storage->getQuery() ->condition('type', $bundle) ->notExists($dest_field) ->exists($source_field) ->accessCheck(FALSE);   $nids = $query->execute();   $sandbox['total'] = count($nids); $sandbox['ids'] = array_chunk($nids, $nodes_per_batch); $sandbox['current'] = 0; }   if ($sandbox['total'] == 0) { $sandbox['#finished'] = 1; return; }   $nids = array_shift($sandbox['ids']); $nodes = $storage->loadMultiple($nids);   /* @var $node \Drupal\node\NodeInterface $node */ foreach ($nodes as $node) { $node->$dest_field = $node->$source_field; // Programmatically copy field data $node->save(); $sandbox['current']++; }   $sandbox['#finished'] = min(($sandbox['current'] / $sandbox['total']), 1); }

In this case, the $sandbox variable is passed by reference to each iteration of the post_update hook. It will loop over this function until $sandbox['#finished'] == 1 — or until the current node operation is equal to the total number of nodes.

In my case, I needed to run this operation on a few different fields across half a dozen content types each with their own mappings — I’ll just use article and post in my example below. To make it a little easier, I wrote the custom callback _my_module_copy_field_values to apply updates on a per content type and field basis. Then I called it from a few implementations of hook_post_update_NAME, one for each content type.

With your custom callback _my_module_copy_field_values defined, you simply call it in your hook_post_update_NAME implementations defined in your MY_MODULE.post_update.php file. Then when you run database updates, your work is done.

/** * Migrate Article field_old_one > field_new. */ function my_module_post_update_8001_migrate_alert_department(&$sandbox) { _my_module_copy_field_values($sandbox, 'article', 'field_old_one', 'field_new'); } /** * Migrate Post field_old_two > field_new. */ function my_module_post_update_8002_migrate_service_department(&$sandbox) { _my_module_copy_field_values($sandbox, 'post', 'field_old_two', 'field_new'); }

Executing your field level changes in hook_post_update_NAME versus hook_update ensures that any schema level changes (which should be in hook_update) are completed before your content level changes — just in case you’ve got some other updates going on or are working with a handful of other developers in the same codebase.

Do you have a simpler way to do this? Feel free to share in the comments.

John Ferris

Tag1 Consulting: Does your content speak for itself? A fireside chat with Preston So, author of Voice Content and Usability - Part 1

Main Drupal Feed - Tue, 06/22/2021 - 14:00

For thousands of years, much of the content that fills our books and today lines our websites has been rooted in the written word. But in recent decades, voice interfaces have grown in both performance and popularity as users begin to seek novel ways to access information, especially through the uniquely human medium of spoken content. How do we adjust to the new paradigm of voice content—copy and media conveyed through sound—when our content strategy and design approaches remain moored in visual experiences?

Read more lynette@tag1co… Tue, 06/22/2021 - 07:00

Ben's SEO Blog: The XML Sitemap Module

Main Drupal Feed - Tue, 06/22/2021 - 13:32
The XML Sitemap Module Having an XML sitemap gives Google a list of the pages that you wish them to crawl. While they can crawl your site without it, large & complex sites confuse the crawler so it could potentially miss pages and even whole sections. Tracy Cooper Tue, 06/22/2021 - 08:32

Specbee: How to Discipline your Code with Refactoring (Includes PHP examples)

Main Drupal Feed - Tue, 06/22/2021 - 11:04
How to Discipline your Code with Refactoring (Includes PHP examples) Pradosh 22 Jun, 2021 Top 10 best practices for designing a perfect UX for your mobile app

Like many other things in life, our code needs some discipline too. I’m pretty sure no developer in the world wants to write unclean code. However, unclean code still does exist. It can arise due to various reasons - may be due to business pressure, lack of documentation, lack of interaction among team members or incompetence of the developer. Due action needs to be taken to make the code cleaner and to avoid problems that may come up in the future because of this. Fortunately, we can tackle these issues with a disciplined technique to restructure the code called as Refactoring.

Refactoring is a technique to improve the internal structure of the existing program source code and maintaining its external behavior. It is a step-by-step procedure to improve the code, which will otherwise cost us a lot of time and effort.

Disadvantages of Unclean Code

Expanding the source code size by adding new programs to it without refactoring for a long time makes the code messy and unclean. It makes the maintenance and further development on the project very difficult. Unclean code comes with tons of disadvantages:

  1. It increases the maintenance cost of the project.
  2. Adding new feature takes a lot of time and sometimes it become impossible to add.
  3. It slows down the introduction of new people to the project.
  4. It contains duplicate code.
  5. It does not pass all tests.

There are many other disadvantages, but these problems cost a lot of money and time to the organization.

Advantages of Clean Code

Clean and disciplined code has its own advantages:

  1. It does not contain duplicate code.
  2. It passes all tests.
  3. Makes the code more readable and easier to comprehend.
  4. It makes the code easier to maintain and less expensive.

Advantages of clean code are many. The process of turning a messy unclean code into a more maintainable clean code is called Refactoring process.

Refactoring Process

Refactoring should be done as a series of small changes, each of which slightly improves the existing code and allows the program to continue to run without breaking it. After refactoring, code should become cleaner than before. If it remains unclean, then there is no point of refactoring. It is just a loss of time and effort. No new code should be added during refactoring to create new functionality. It should pass all the tests after refactoring.

When to Refactor

Refactoring should be performed when:

  • Adding duplicate code to the project. Because duplicate code is hard to maintain and changes in one place may require updates in many other places.
  • Adding a feature. Refactoring makes it easier to add new functionality.
  • When fixing a bug, you should refactor because it will make the bug discovered automatically.
  • Code review is the last stage of refactoring the code before changes are deployed to production.
Dealing with Code Smells

Problems on the code are sometimes referred to as code smells. These are the problems addressed during the refactoring. They are easier to find and fix.

For example:

  • Large methods and classes which are very hard to work with.
  • Incomplete or incorrect usage of object-oriented programming concept.
  • Code that makes it hard to add any changes.
  • Duplicate and deprecated code in the project.
  • Highly coupled code.
Refactoring Techniques

Refactoring techniques are the steps taken to refactor the code. Some of the refactoring techniques are:

1. The Extract Method

// Problem

function printInvoice() {     $this->printHeader();        // Print details.     print("name:  " . $this->name);     print("amount " . $this->getPrice()); }

// Solution

function printInvoice() {     $this->printBanner();     $this->printDetails($this->getPrice()); }    function printDetails($price) {     print("name:  " . $this->name);     print("amount " . $outstanding); }

If you have a code fragment that can be grouped, add a new method for that part of code and replace the old code. It makes the code more isolated and removes duplication.

2. Extract Variable

// Problem

if (($student->getMarksinMath() > 60) &&     ($student->getMarksInPhysics() > 60) &&     ($student->getMarksinChemistry() > 60) && $this->pass) {   // do something }

// Solution

$mathResult = $student->getMarksinMath() > 60; $physicsResult = $student->getMarksinPhysics() > 60; $chemistryResult = $student->getMarksinChemistry() > 60; $hasPassed = $this->pass; if ($mathResult && $physicsResult && $chemistryResult && $hasPassed) {   // do something }

For large expressions like the one displayed in the problem, which is very hard to understand, different variables can be created for each expression. It makes the code more readable. But this method should be applied with caution. However, it has its own disadvantages. The code will execute even if the condition is false which is not the case in the problem.

3. The Inline Method

// Problem

function printResult() {     return ($this->getResult()) ? “Pass” : “Fail”; } function getResult() {     return $this->totalMarks > 300; }

// Solution

function getRating() {     return ($this->totalMarks > 300) ? “Pass” : “Fail”; }

When the method body is more obvious, use this technique. Replace the method with method content and delete the method. It minimizes the number of unwanted methods.

4. Inline Temp

// Problem

$mathMark = $student->getMathResult(); return $mathMark > 60;

// Solution

return $student->getMathResult() > 60;

If there is an unwanted temporary variable which just holds the expression result, remove the variable with the expression itself. It helps in getting rid of unnecessary variables.

5. Replace array with object

// Problem

$row = []; $row[0] = "Virat Kohli"; $row[1] = 70;

// Solution

$row = new Player(); $row->setName("Virat Kohli"); $row->setNumberofCentury(70);

If there is an array with various types of data, replace that with an object. Because fields of a class are easier to document and maintain than arrays with various types of data.

6. Parameterized Method

// Problem

function fivePercentRaise() { } function tenPercentRaise() {    }

// Solution

function raise(percent) { }

If multiple methods perform similar action on data, then replace all the methods with one method and pass the data as argument(s). It removes duplicate and redundant methods.

7. Separate query from modifier

// Problem

function getInterest() {     $this->interestAmount = $this->principal * 10 / 100;     return $this->interestAmount; }

// Solution

function setInterest() {     $this->interestAmount = $this->principal * 10 / 100; } function getInterest() {     return $this->interestAmount; }

If a method is returning value and changing the object, split the two methods. One for modification and another to return the result. It removes the chance of unintentional modification of an object.

Unclean and chaotic code leads to technical debt that keeps adding up if not tackled right. And a debt always means a loss. Refactoring the code is a technique that can help fight issues that leads to bad and smelly code. Need help or more information on refactoring your code? Contact Specbee’s specialists today!

Drupal Development Drupal Planet Web Development Coding Shefali ShettyApr 05, 2017 Subscribe For Our Newsletter And Stay Updated Subscribe

Leave us a Comment

  Shefali ShettyApr 05, 2017 Recent Posts Image How to Discipline your Code with Refactoring (Includes PHP examples) Image Top 10 Things you need to know about CSS Grid Layouts Image Building (more) Secure Drupal Websites with the Password Policy Module Want to extract the maximum out of Drupal? TALK TO US Featured Success Stories

A Drupal powered multi-site, multi-lingual platform to enable a unified user experience at SEMI.

link

Discover how our technology enabled UX Magazine to cater to their massive audience and launch outreach programs.

link

Discover how a Drupal powered internal portal encouraged the sellers at Flipkart to obtain the latest insights with respect to a particular domain.

link

Jacob Rockowitz: How should we encourage organizations to sponsor the Webform module's Open Collective?

Main Drupal Feed - Mon, 06/21/2021 - 21:40

In January 2021, I started writing about my work situation. As that aspect of my life (and my blog) evolved, I gradually started focusing on improving the sustainability of the Webform module for Drupal. Last month, I began expensing the Webform module's maintenance to the Webform module's Open Collective. Getting compensated for my time has been a great experience, and I am very grateful to the backers of the Webform module's Open Collective.

To my delight, with each blog post, more and more individuals and some organizations are becoming backers of the Webform module's Open Collective. Why individuals would want to help support the Webform module makes perfect sense to me. Individuals generally have some immediate understanding of the benefits of the Webform module or the challenge of maintaining an open source project or contribution. This is why I back Drupal's Simplytest.me, Drupal Recording Initiative, and the Gin Admin Theme collectives. One of the patterns I’ve noticed in the open source community, the Drupal community, and in Open Collectives is that individuals tend to understand and appreciate both the inherent value of open source and the need to contribute. Alternatively, organizations don't always see the value and need of helping, contributing to, and supporting the open source software they use to build and maintain their businesses.

Why do we need to get more organizations involved?

To my mind, it’s crucial to get more organizations involved for two reasons: First, organizations generally gain more financial resources from open source, either using it for their business or offering it as a service to their clients...Read More

Web Omelette: <p>In this article I present a short

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I present a short extract from my book Drupal 9 Module Development. The topic: menu system and types of menu links.

Web Omelette: <p>In this short article I introduce a

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this short article I introduce a new Drupal module that allows you to define Ajax-based multi-value form elements.

Web Omelette: <p>In this article I am going to show

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I am going to show you a neat little trick for having Ajax powered buttons rendered inside a table form.

Web Omelette: <p>In this article I introduce the

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I introduce the Composite Reference Drupal module that can be used for parent-child entity relations that are supposed to live (and die) together.

Web Omelette: <p>In this excerpt from the book Drupal

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this excerpt from the book Drupal 8 Module Development, I introduce the TypedData API.

Web Omelette: <p>In this excerpt from the book Drupal

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this excerpt from the book Drupal 8 Module Development, I introduce automated testing in Drupal.

Web Omelette: <p>In this article I am going to

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I am going to quickly show you a neat little addition to the migrate Entity destination that runs validation on entities before saving them.

Web Omelette: <p>In this article I am going to show

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I am going to show you a quick trick to speed up the generation of the CSV source plugin configuration for large CSV files when doing Drupal migrations.

Web Omelette: <p>In this article I am going to show

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I am going to show you how to build dynamic migrations that depend on the state of your system by using (migration) plugin derivatives.

Web Omelette: <p>In this article I am going to show

Main Drupal Feed - Mon, 06/21/2021 - 16:54

In this article I am going to show you the power of using Drupal 8 filters to render your basic markup in a way compliant with various frontend frameworks like Bootstrap.

Skvare.com: Training Video: Doing More with Views, Calendars & Maps

Main Drupal Feed - Mon, 06/21/2021 - 15:29
Training Video: Doing More with Views, Calendars & Maps

Watch Part 3 of our CiviCRM Entity training series.

Gena Dellett Mon, 06/21/2021 - 10:29

WP Briefing: Episode 11: WordCamp Europe 2021 in Review

Wordpress News - Mon, 06/21/2021 - 12:33

In this episode, Josepha Haden Chomphosy does a mini deep dive into WordCamp Europe 2021, specifically the conversation between the project’s co-founder, Matt Mullenweg, and Brian Krogsgard formerly of PostStatus. Tune in to hear her take and for this episode’s small list of big things.

Have a question you’d like answered? You can submit them to wpbriefing@wordpress.org, either written or as a voice recording.

Credits

Editor: Dustin Hartzler

Logo: Beatriz Fialho

Production: Chloé Bringmann

Song: Fearless First by Kevin MacLeod

References

Gutenberg Highlights 

Matt Mullenweg in conversation with Brian Krogsgard 

5.8 Development Cycle

WordCamp Japan

A recap on WCEU 2021

Transcript

Josepha Haden Chomphosy 00:10

Hello, everyone, and welcome to the WordPress Briefing, the podcast where you can catch quick explanations of the ideas behind the WordPress open source project, some insights into the community that supports it, and get a small list of big things coming up in the next two weeks. I’m your host, Josepha Haden Chomphosy. Here we go!

Josepha Haden Chomphosy 00:40

A couple of weeks ago, we hosted WordCamp Europe and had the double pleasure of a demo that showed us a bit about the future of WordPress and an interview that looked back while also looking a bit forward. If you haven’t seen the demo, it was beautiful. And I’ve included a link to it in the show notes. And if you haven’t heard the interview, there were a few specific moments that I’d like to take the time to delve into a little more. Brian Krogsgard, in his conversation with Matt Mullenweg, brought up three really interesting points. I mean, he brought up a lot of interesting points, but there were three that I would particularly like to look into today. The first was about balance. The second was about cohesion. And the third was about those we leave behind.  

Josepha Haden Chomphosy 01:24

So first is this question of balance. Brian brought this up in the context of the overall economic health of the WordPress ecosystem. And in that particular moment, he talked about companies that are coming together, companies that are merging. And in Matt’s answer, the part that I found the most interesting was when he said, “the point at which there is the most commercial opportunity is also the point at which there is the most opportunity for short-termism. He went on to talk about the importance of long-term thinking and collective thinking about what makes us, and us here means probably the WordPress project, more vibrant and vital in 10 or 20 or 30 years. One of the things that he specifically called out in that answer was the responsibility of larger companies in the ecosystem. For instance, like Automattic, to commit fully to giving back, there are many ways now that companies can give back to WordPress so that we all replenish the Commons. They can pay for volunteer contributors’ time; they can create and sponsor entire teams through the Five for the Future program. They can contribute time through our outreach program. And they can even contribute to WordPress’s ability to own our own voice by engaging their audience’s awareness of what’s next in WordPress, or whatever. And I know this balance, this particular balance of paid contributors or sponsored contributors, compared to our volunteer contributors or self-sponsored contributors; I know that this balance is one that people keep an eagle eye on. I am consistently on a tight rope to appropriately balanced those voices. But as with so many things where balance is key, keeping an eye on the middle or the long-distance can really help us get it right.  

Josepha Haden Chomphosy 03:23

The second question was one of cohesion and specifically cohesion over the competition. Brian asked how, if people feel disadvantaged, you can foster a feeling of cohesion rather than competition? And Matt’s first answer was that competition is great. Specifically, he said that competition is great as long as you consider where your collaboration fits into the mission. And he also spent some time exploring how competitors in the ecosystem can still work from a community-first mindset. I personally cannot agree enough about some of the benefits of collaboration alongside your competitors. I remind sponsored contributors from time to time, and I think it’s true for any contributor that you are an employee of your company first and a contributor to WordPress second. However, once you step into contribution time, your main concern is the users of WordPress, or new contributors, or the health of the WordPress ecosystem as a whole or the WordPress project. So you get all this subject matter expertise from competitive forces, collaborating in a very us versus the problem way. And when you do that, you’re always going to find a great solution. It may not be as fast as you want it to build things out in the open in public. And so sometimes we get it wrong and have to come back and fix it but still, given time, we’re going to come out with the best solution because we have so many skilled people working on this.  

Josepha Haden Chomphosy 05:01

And then the third question that I wanted to really touch on is the question of those we leave behind. Brian asked Matt if he thought mid-sized agencies and mid-sized consultants were being squeezed out with the block editor. Matt’s high-level answer was no, and I tend to agree with him. It’s not all mid-sized anything any more than it’s all small-sized anything. His answer continued to look at what stands to change for users with the block editor and who really can stand to benefit. It made me think back to my WordPress 5.0 listening tour. We launched WordPress 5.0, which was, in case anyone forgets, the first release with the block editor in it. I took a six-month-long tour to anywhere that WordPressers were so I could hear their main worries, what Brian is saying in there, and what Matt is saying to really came up all the time in those conversations. And basically, it was that this update takes all the power away from people who are building websites. And in these conversations, and Matt and Brian’s conversation, it was really focused on our freelancers and consultants. But at the same time, all of them heard that this update gives power back to all of the people who could build websites. 

Josepha Haden Chomphosy 06:28

I could not shake the feeling at the time. And honestly, I can’t shake it now that no high-end consultants, or freelancers, or any other developer or site creator sit around just longing for maintenance work. After six months of talking to people, I didn’t hear anyone say, “you know, I just love making the same author card over and over and over.” Or, “updated the footer every week, this month. And that’s why I got into this business.” And more than the feeling that there just wasn’t anyone who just loved maintenance, I got a feeling that there were real problems that needed to be solved for these clients and that they wanted to solve them. And that they also would gladly trade updating footers for the much more interesting work of creating modern and stylish business hubs based on WordPress for the clients who trust them so much. All of that, I guess, is to say that, yes, the block editor does give power back to our clients again, but not at the expense of those who have to build the sites in the first place. I think it stands to restore everyone’s sense of agency more than we truly realize. So that’s my deep dive on WordCamp Europe; I included links to the demo and the talk below, just in case you haven’t seen them yet. And you want to get a little bit of insight into the full context of the conversations that I just did a bit of a deep dive into. 

Josepha Haden Chomphosy 08:15

And now it’s time for our smallest of big things. All right, I have three things for you today. Number one, tomorrow, we package WordPress 5.8 beta three. If you’ve never had a chance to stop by the core channel in slack for the past packaging process, I really encourage you to stop by; we call them release parties. It’s a bunch of people who stand around and help get it done. So you can also see how it gets done. And if you’re feeling brave, you can even try your hand at testing out one of the packages as soon as it’s ready. The second thing is that a week from tomorrow, we reach our first release candidate milestone. So if you have meant to submit any bugs or patches or if you’ve been procrastinating on documentation, or dev notes, right now is the time so that we can have a chance to get everything into the release by the time we reach the release candidate milestone on the 29th. And the third thing is that we are currently right in the middle of WordCamp Japan. That is a great opportunity to meet some contributors and maybe even get started with contributions yourself. So stop by if you haven’t had a chance to check it out already. I will leave a link in the show notes. And that, my friends, is your small list of big things.

Thank you for tuning in today for the WordPress Briefing. I’m your host, Josepha Haden Chomphosy, and I’ll see you again in a couple of weeks.

Agiledrop.com Blog: Why outsourcing is the way to go for times of uncertainty

Main Drupal Feed - Mon, 06/21/2021 - 05:20

In this article, we look into why outsourcing is so well suited for times of uncertainty and how businesses can benefit from it.

READ MORE

#! code: Drupal 9: Changing Config Through Update Hooks

Main Drupal Feed - Sun, 06/20/2021 - 21:39

Drupal configuration is normally changed or removed through the configuration import and export process. For example, the process I follow is to make the change in the configuration locally, export the configuration into the source code, deploy the source code to a remote server and import the configuration. Using this mechanism, configuration changes that were exported locally are imported into the site and are ready to use.

There are certain situations where using update hooks to update the configuration is necessary. This means that you would change the configuration in your system directly using code in update hooks, rather than following the export and import process. These situations are rare, but necessary from time to time in order to maintain a consistent configuration on your site.

Key to all of this is to always run your update hooks before performing your configuration import. This is important rule to follow as the Drupal update process can alter or tweak the fields and tables that contain Drupal configuration entities. Then, when importing the Drupal configuration the data structure is in the correct state and is ready to accept the changes.

Let's look at a few of the situations that you might encounter and how to approach each of them using update hooks.

Updating Configuration Splits

If you are using configuration splits to manage your different environments then you will encounter an issue where you import your configuration and then realise you need to import the configuration again.

Read more.

Pages