ycloudyusa/yusaopeny_gated_content

Y USA 开放 Y 虚拟 Y 内容

安装次数: 14,743

依赖项: 0

建议者: 0

安全: 0

星级: 2

关注者: 1

分支: 28

开放问题: 5

类型:drupal-module

1.9.2 2024-06-14 12:12 UTC

README

虚拟 Y 是一个用于 Open Y 的包,包含组织 Y 客户受保护内容的所需功能。

当前开发活动正在进行于 YUSA 分支。请将拉取请求提交到那里。一旦审核和发布,它们将被拉入此仓库。

服务器要求

为了工作,虚拟 Y 需要 HTTP 服务器允许

  • GET
  • POST
  • DELETE http 方法。

子模块

  1. 认证系统 - 用于不同认证类型的插件系统。
  2. 演示 - 一组迁移,用于在虚拟 Y 的初始步骤中安装演示内容
  3. 存储 - 用于虚拟 Y 的实体集
  4. 日志 功能,用于跟踪虚拟 Y 用户的操作。
  5. 共享内容 - 允许您从共享网络下载内容的模块
  6. 共享内容服务器 - 用于 shared.openy.org 服务器的模块

安装

请参阅这些说明的视频版本 。这假设您已经 构建了 Open Y 网站 并已启动它。

  • 将此模块添加到您的代码库中。
    • 通过 composer: composer require ycloudyusa/yusaopeny_gated_content
    • 不使用 composer:不推荐这样做。
  • 启用模块
    • 通过 UI
      • 访问工具栏中的 扩展
      • 选择 "Virtual Y Base","Open Y Virtual YMCA Storage" 和 "Open Y Virtual YMCA Auth Example"。
      • 安装并选择 "是" 以添加所有必需的依赖项。
    • 通过 drush: drush en openy_gated_content openy_gc_auth_example -y
  • 通过 结构 > 分类法 添加这些词汇表中的至少一个项目
    • 虚拟 Y 类别
    • 虚拟 Y 设备
    • 虚拟 Y 级别
  • 创建一个 落地页面 并将 虚拟 Y 内容 段落添加到 内容区域
  • 从工具栏转到 虚拟 Y > 视频 > 添加视频 并添加一段视频内容。
  • 访问您创建的落地页面,点击登录,观察您的新虚拟 Y。

升级路径

已知问题

如果您遇到

 [error]  Configuration <em class="placeholder">user.role.anonymous</em> depends on configuration (<em class="placeholder">rest.resource.openy_gc_auth_custom, rest.resource.openy_gc_auth_custom_confirm</em>) that will not exist after import.

看起来之前的更新失败了。如果您不使用自定义认证提供程序,请禁用该模块,这应该会有所帮助。如果您使用它,请尝试手动删除该配置并再次尝试

drush cdel rest.resource.openy_gc_auth_custom_confirm

另一个

Drupal\Component\Plugin\Exception\PluginNotFoundException while adding Views handlers for field Parts of day on index Default: The "" plugin does not exist. Valid plugin IDs for Drupal\search_api\DataType\DataTypePluginManager are: boolean, date, integer, decimal, string, text in

这个错误是因为其中一个服务位于自定义文件夹中。尝试分析哪个服务已损坏并修复它。

开发

在开发过程中,您可能希望启用一组模块。使用 openy_gc_demo 模块来实现此目的。指定您想要启用的模块作为此模块的依赖项。CI 配置会自动启用此模块及其所有依赖项。

编码标准

PHPCS

请查看 .phpcs.xml 中的 PHPCS 配置。

要使用此配置,只需在模块目录中运行 phpcs

您可以将此脚本添加到 .git/hooks/pre-commit 中,以便在 git commit 时运行 phpcs 和 phpcbf。

PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
cd $PROJECT
echo "Running phpcs and phpcbf..."
phpcs .
if [ $? != 0 ]
then
    phpcbf .
    exit 1
fi

eslint

请查看 js/gated-content/.eslintrc.js 中的 eslintrc 配置。

要执行检查,请运行 npm install && npm lint-no-fix。有关详细信息,请参阅 js/gated-content/package.json

使用 npm lint 可提供自动代码修复功能。

使用 docksal for openy

用于构建 PR 构建的 docksal 配置 https://github.com/fivejars/docksal-for-openy/tree/openy-gc-builds 被用于构建。

要使用它,您必须安装 Docksal。

按照以下说明获取提供 4 个本地网站(每个基础主题一个,且尚未安装 Open Y)的工作本地环境。

mkdir vymca
cd vymca
git clone --branch openy-gc-builds \
  git@github.com:fivejars/docksal-for-openy.git .docksal
git clone git@github.com:fivejars/yusaopeny_gated_content.git
mkdir -p docroot/libraries docroot/sites/default/config/staging
wget -N https://raw.githubusercontent.com/fivejars/yusaopeny-project/8.2.x-gated-content-ci/composer.json
docker volume create --name=composer_cache
fin init

Vimeo 私有视频

对于通过“特定域名”嵌入保护的视频,您可能会遇到缩略图下载到 Drupal 媒体的错误。在这种情况下 - 为 Drupal 核心应用补丁。

  • patches/OEmbed_vimeo_private_videos.patch - 使用核心媒体时
  • patches/video_embed_field_vimeo_private_videos.patch - 使用 video_embed_field 模块时

需要 JSON API 补丁的 Drupal 8.7

{
  "extra": {
    "patches": {
      "drupal/core": {
        "JSONAPI wont install (8.7-specific)": "https://www.drupal.org/files/issues/2019-05-23/jsonapi_2996114.patch"
      }
    }
  }
}

迁移说明

如果您有错误

TypeError: Argument 6 passed to __construct() must be an instance of EntityTypeManagerInterface

将补丁应用到 composer.json

{
  "extra": {
    "patches": {
      "drupal/paragraphs": {
        "3079627": "https://www.drupal.org/files/issues/2019-09-06/3079627-4.paragraphs.Argument-6-passed-to-construct.patch"
      }
    }
  }
}