ymcatwincities/openy_gated_content

此包已被废弃,不再维护。作者建议使用ycloudyusa/yusaopeny_gated_content包代替。

Open Y 虚拟Y内容

安装量: 19,056

依赖项: 2

建议者: 0

安全: 0

星标: 5

关注者: 10

分支: 25

开放问题: 18

类型:drupal-module

1.6.3 2022-04-26 20:00 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站点并且它正在运行。

  • 将此模块添加到您的代码库。
    • via composer: composer require ymcatwincities/openy_gated_content
    • 不使用composer: 这不推荐。
  • 启用模块
    • 通过UI
      • 访问工具栏中的扩展
      • 选中“虚拟Y基础”、“Open Y虚拟YMCA存储”和“Open Y虚拟YMCA认证示例”。
      • 安装并确认添加所有必需的依赖项。
    • Via 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 中找到 esling 配置。

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

使用 npm lint 可进行自动代码修复。

对于 OpenY 的 docksal

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

为了使用它,您必须安装 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/openy_gated_content.git
mkdir -p docroot/libraries docroot/sites/default/config/staging
wget -N https://raw.githubusercontent.com/fivejars/openy-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 模块时

对于 Drupal 8.7 需要的 JSON API 补丁

{
  "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"
      }
    }
  }
}