Sometimes, when we use a contrib module in Drupal, we encounter a bug. Chances are that someone has already fixed it and contributed a patch to the Drupal community.
有时,当我们在Drupal中使用contrib模块时,会遇到一个错误。 很有可能有人已经修复它并为Drupal社区贡献了补丁。
First, let’s assume our site root folder is /var/www/public/drupal_site.
首先,假设我们的站点根文件夹为/ var / www / public / drupal_site 。
This example will patch the module Scroll to destination anchors (https://www.drupal.org/project/scroll_to_destination_anchors)
此示例将修补模块滚动到目标锚点 ( https://www.drupal.org/project/scroll_to_destination_anchors )
These are the steps to apply a patch to a module using Composer:
这些是使用Composer将补丁应用到模块的步骤:
使用Composer添加模块 (Add the module with Composer)
To download the module to our site, all we have to do is run this command in a terminal while being in the site root folder:
要将模块下载到我们的站点,我们要做的就是在站点根目录中的终端中运行以下命令:
composer require drupal/scroll_to_destination_anchors
作曲家需要drupal / scroll_to_destination_anchors
This command will download the