Drupal Planet

Talking Drupal: Talking Drupal #351 - Core Theming $h!t

3 months 2 weeks ago

Today we are talking about Core Theming with Cristina Chumillas.

www.talkingDrupal.com/351

Topics
  • What’s newe in core themeing?
  • Why is Claro in core important?
  • Why is Olivero in core important?
  • Why was it so long between new themes?
  • Continuous improvement?
  • What is the biggest improvement?
  • What happens to old themes?
  • Accessibility
  • CSS
    • Build tools
  • Drupal 10
    • IE
    • UC
  • Compound elements
  • Getting involved
Resources Guests Hosts

Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Mike Herchel - herchel.com - @mikeherchel

MOTW

Quicklink This module provides an implementation of Google Chrome Lab’s Quicklink library for Drupal. Quicklink is a lightweight (< 1kb compressed) JavaScript library that enables faster subsequent page-loads by prefetching in-viewport links during idle time.

Jacob Rockowitz: Baking a Recipe using the Schema.org Blueprints module for Drupal

3 months 2 weeks ago

In my last post, I introduced the Schema.org Blueprints module to the Drupal community. At DrupalCamp NJ, I shared a presentation about the module. The blog post and presentation managed to collect a bunch of helpful feedback, which encouraged me to simplify the module's dependencies and relationships. One of the biggest improvements is that JSON-LD is now fully supported with previews and dedicated API support. The entire module is still under active development. As you read this new post, new features are being added (and removed).

The reality is the Schema.org Blueprints module is turning into a pretty large undertaking. I will need help from individuals and organizations in the Drupal community to launch a stable release. At the same time, by not having an alpha release, I can frame out most of the core APIs and challenges quickly while making changes as needed. Leveraging a Schema.org-first approach to modeling content in Drupal has required a lot of thought and strategy. The sustainability of the module is going to need an equal amount of effort and a dedicated blog post. For now, I need to build up the Drupal community's interest in the module by creating content and demos that showcase the Schema.org Blueprints module in action by baking a recipe.

Recipes are among the most shared content types on the web and probably the most shared content off the web. In the Drupal community, we have chosen to provide a recipe website, named Umami, as our out-of-the-box demo site. Umami's recipe content type is based on https://Schema.org/Recipe. Umami's recipe...Read More

Palantir: Drupal Rector: Progress Update

3 months 2 weeks ago

How the 0.12.4 release fixes the most common Drupal 10 depreciations

With Drupal 10 scheduled for December 14, 2022, we’ve been working with Matt Glaman, Gábor Hojtsy, and the Drupal 10 Readiness team to ensure that Drupal Rector can help upgrade modules for Drupal 10.

As part of that work, we recently released Drupal Rector 0.12.4. The 0.12.4 release is a stable release pinned to Rector 0.12.21. The 0.12.4 includes fixes for the 5 most common Drupal 10 deprecations:

  • drupal_get_path()
  • file_create_url()
  • render()
  • file_url_transform_relative()
  • file_save_data()

Developers should be aware that Rector 0.12.22 includes breaking changes to how we handle Drupal configuration. Therefore, the 0.12.5 release will include Rector 0.12.22, which will force developers to update their Rector configuration.

Luckily, it should be a simple matter of re-copying the configuration file. When we release the 0.12.5, run the following command from your project root:

  • cp vendor/palantirnet/drupal-rector.php .

                [Note the trailing dot - it matters!]

Developers can continue to use the pinned 0.12.4 release, though new update rules will not be available to that release.

Be sure to aggregate to Drupal Planet!

Content Strategy Development Drupal Open Source Site Building Strategy

Palantir: Drupal Rector: Progress Update

3 months 2 weeks ago

How the 0.12.4 release fixes the most common Drupal 10 depreciations

With Drupal 10 scheduled for December 14, 2022, we’ve been working with Matt Glaman, Gábor Hojtsy, and the Drupal 10 Readiness team to ensure that Drupal Rector can help upgrade modules for Drupal 10.

As part of that work, we recently released Drupal Rector 0.12.4. The 0.12.4 release is a stable release pinned to Rector 0.12.21. The 0.12.4 includes fixes for the 5 most common Drupal 10 deprecations:

  • drupal_get_path()
  • file_create_url()
  • render()
  • file_url_transform_relative()
  • file_save_data()

Developers should be aware that Rector 0.12.22 includes breaking changes to how we handle Drupal configuration. Therefore, the 0.12.5 release will include Rector 0.12.22, which will force developers to update their Rector configuration.

Luckily, it should be a simple matter of re-copying the configuration file. When we release the 0.12.5, run the following command from your project root:

  • cp vendor/palantirnet/drupal-rector.php .

                [Note the trailing dot - it matters!]

Developers can continue to use the pinned 0.12.4 release, though new update rules will not be available to that release.

Be sure to aggregate to Drupal Planet!

Content Strategy Development Drupal Open Source Site Building Strategy

Golems GABB: Drupal 9: Auto Tweeting From A Drupal Site When Content Is Published

3 months 2 weeks ago
Drupal 9: Auto Tweeting From A Drupal Site When Content Is Published Editor Mon, 06/13/2022 - 13:32

Once upon a time, tweeting already published content from a Drupal site was a simple task that required no extra effort. The main deal was to install the Social Post Twitter module, and everything worked.
To date, this module, unfortunately, does not work appropriately on Drupal 9. But this does not mean that you need to stop integrating your site with Twitter. It is one of the main communication channels between businesses and potential customers. Integrating social media with your website increases your brand awareness, attracts users to interact, and so has a positive effect on SEO. In a word, there are a lot of pluses.

#! code: Drupal 9: Render A Drupal Page Within A Drupal Request

3 months 2 weeks ago

A recent challenge that I faced on a project was to generate the HTML of a full Drupal page, from within a Drupal request. The project called for a template to be rendered within the structure of a Drupal theme and also to include the styles associated with that theme.

At first, this doesn't seem like a big problem, but once I started trying to figure things out it became much more complex than I was expecting.

The problem is that you can't just render a page using the 'html' and 'page' templates as there is a lot of context surrounding those templates. Without this context in place Drupal produces a page of markup that contains no styles or blocks. The context is how Drupal knows what theme to load, what libraries to add to the page, what preprocess hooks to call, what menu items to generate, and so on.

I found a couple of different solutions to this problem that work quite well.

In both of these situations I will generate the page render and then send it back to the user using a new Response object from a controller. This essentially replaces the response from the Drupal controller with our custom markup.

Solution 1: Render A Page Using A Get Request

Since we are trying to render a page it sort of makes sense that we ask Drupal to render that full page for us through a sub-request. This means making a secondary request using the Guzzle HTTP Client  to the page we want to render and then returning the result of that request in the Response object.

This is perhaps the simplest approach as we just need to figure out the page we want to go to and then make the request to that page.

Here is the action method for a normal Drupal controller where we are rendering node 123 in the full context of a page response. I've left out a bit of boilerplate code here, but you'll want to inject the 'http_client' service into your controller and store it in the objects httpClient property.

Read more.

Security advisories: Drupal core - Moderately critical - Third-party libraries - SA-CORE-2022-011

3 months 2 weeks ago
Project: Drupal coreDate: 2022-June-10Security risk: Moderately critical 13∕25 AC:Complex/A:None/CI:Some/II:Some/E:Theoretical/TD:UncommonVulnerability: Third-party librariesCVE IDs: CVE-2022-31042CVE-2022-31043Description: 

Drupal uses the third-party Guzzle library for handling HTTP requests and responses to external services. Guzzle has released two security advisories:

These do not affect Drupal core, but may affect some contributed projects or custom code on Drupal sites.

We are issuing this security advisory outside our regular Drupal security release window schedule since Guzzle has already published information about the vulnerabilities, and vulnerabilities might exist in contributed modules or custom modules that use Guzzle for outgoing requests. Guzzle has rated these vulnerabilities as high-risk.

This advisory is not covered by Drupal Steward.

Solution: 

Install the latest version:

All versions of Drupal 9 prior to 9.2.x are end-of-life and do not receive security coverage. Note that Drupal 8 has reached its end of life.

Drupal 7 is not affected.

Reported By: Fixed By: 

Peoples BLOG: Store Secrets Securely on Pantheon for Drupal Application

3 months 2 weeks ago
In this article, we are going to see how people can store access keys and tokens securely, in the case of your drupal application that is managed on pantheon. Generally, all the Access keys or Tokens or any Secret third party auth information should not be stored in the database or within the project web root, Its safe to store it encrypted and within a file, and keep the file outside of the proj

Drupal blog: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

3 months 2 weeks ago

Drupal 9.4.0-beta1 has been recently released, which defines all deprecated APIs for Drupal 10 (other than whole deprecated modules). Drupal 10.0.0 is scheduled to be released on December 14, 2022. The upgrade from Drupal 9 to Drupal 10 should be even easier than Drupal 8 to 9 was. Making a project that's already compatible with Drupal 9 compatible with Drupal 10 requires removing deprecated API uses. When looking at just one project, there are usually only a few of those that need changing, but when we consider managing over 8,200 Drupal 9 modules on drupal.org the upgrade process could easily take hundreds or thousands of hours from the Drupal community.

Fortunately we can accelerate this process dramatically by using Drupal Rector, a tool developed by Palantir.net and Pronovix. Drupal Rector can be used by developers to automatically fix many of the deprecated API uses needed to make a module Drupal 10 compatible. In fact Drupal Rector can currently fix deprecated API uses in thousands of existing projects on Drupal.org. Although using Drupal Rector is not difficult, running it manually on all Drupal 9 projects would have taken hundreds of developer hours to complete.

To accelerate upgrading of modules to Drupal 10 the Drupal Association has partnered with Acquia and Palantir to automatically provide patches generated by Drupal Rector for all contributed modules possible. For many modules these patches will be able to make the modules fully compatible with Drupal 10. For some modules it will still be necessary for a developer to manually replace other deprecated API uses. Patches will also be provided for contributed themes.

These patches will be posted to issues created by the Project Update Bot which was also used for the same purpose in the Drupal 8 to 9 upgrade. The bot is not associated with any individual or company and therefore will not affect issue credits for any individual or company. If maintainers find the patches provided by the bot useful they are welcome to credit the bot account as a way to provide feedback on this initiative.

It will be up to the project maintainers to decide if they want to use these patches but in many cases the patches can help speed up the process of updating a module for Drupal 10 dramatically.

Maintainer Options

For project maintainers there are a few options for dealing with these issues

  1. Leave the issue open and apply the provided patch to remove some or all Drupal 10 deprecated API uses. The Project Update Bot will check weekly if Drupal Rector is able to remove new deprecated API uses and post a new patch if possible.

  2. Remove the “ProjectUpdateBotD10” tag from the issue to stop new patches from being posted. If you would like to use the issue and the patch as a starting point simply remove this tag and the bot will not post any new patches. Add the tag back and the bot will post new patches if possible.

  3. Close the issue to stop the bot from posting new patches. If you are already handling deprecated APIs in another issue or otherwise don’t find the patches helpful simply close the issue and the bot will not post any new patches

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecated API uses, you can file an issue in the Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Infrastructure project issue queue using the component “Bot: Drupal Rector”.

rachel_norfolk: Is a project meeting “activity” or “documentation”?

3 months 2 weeks ago
Is a project meeting “activity” or “documentation”?

It has been interesting talking with colleagues about how we best record things like meetings in the project I’m now involved in, GovStack

To encourage contribution, volunteer contributors, especially but not exclusively, need to feel that the decision making in the project is clear and open - there should never be a difficulty in finding how decisions were made.

Rachel Thu, 06/09/2022 - 16:16 Tags

Peoples BLOG: Configuration management via Quicksilver on Pantheon

3 months 2 weeks ago
As we saw in the earlier article, like how we manage the configuration across the environments. In this article we are going to see how Drupal configurations can be deployed or imported across the environments with the help of Quicksilver which hooks into platform workflows to automate your Pantheon WebOps workflow across the environments. In the pantheon environment’s drupal code base, yo

Web Wash: How to Manage Comments in Drupal

3 months 2 weeks ago

Drupal ships with flexible commenting functionality out of the box. Although there is a bit of a learning curve (as with many things in Drupal), once you understand the core concepts and how to manipulate the different features, you will be exposed to the power of managing comments within Drupal.

This tutorial will teach you how to manage comments in Drupal. We’ll cover the following:

  • Add comments within Drupal
  • Allow anonymous users to comment in Drupal
  • Moderate comments in Drupal
  • Create your custom comment type in Drupal
Checked
5 minutes 35 seconds ago
Drupal.org - aggregated feeds in category Planet Drupal
Subscribe to Drupal Planet feed