🇲🇽Mexico @ovilla

Account created on 23 February 2021, almost 4 years ago
#

Recent comments

🇲🇽Mexico ovilla

In case anyone else gets the same error, here's the patch

🇲🇽Mexico ovilla

Thanks for the answer jurgenhaas.

It is an action plugin created by the HTTP Client Manager module, with that action I'm trying to request an API of rocket.chat to create a room, and among other things I want to send a list of users to join that room, but I need to send them as an array as described here:

https://developer.rocket.chat/reference/api/rest-api/endpoints/rooms/roo...

I have 2 files to describe the API to be used with HTTP Client Manager, these are:

src/api/rocket_chat.yml

name: "rocket.chat API"
apiVersion: "1.0"
description: "Client wrapper for the rocket.chat API."
imports:
  - "resources/rooms.yml"

src/api/resources/rooms.yml

operations:
  CreateDiscussion:
    httpMethod: "POST"
    uri: "rooms.createDiscussion"
    summary: "Create discussion"
    parameters:
      X-Auth-Token:
        location: "header"
        default: "token"
      X-User-Id:
        location: "header"
        default: "userid"
      Content-Type:
        location: "header"
        default: "application/json"
      prid:
        type: "string"
        location: "json"
        description: "Parent room ID of the discussion."
        required: true
      t_name:
        type: "string"
        location: "json"
        description: "Discussion name."
        required: true
      users:
        type: "array"
        location: "json"
        description: "Array of users to join in the discussion, if not provided, it will be an empty array. (Note: if provided, it must be an array)."
        required: false
        default: []
        items:
          "$ref": "Users"
      pmid:
        type: "string"
        location: "json"
        description: "Parent message ID (if the discussion comes from a message)."
        required: false
      reply:
        type: "string"
        location: "json"
        description: "The reply of the discussion."
        required: false
    responseModel: "CreateDiscussionResult"
models:
  Users:
    type: "string"
    location: "json"
  CreateDiscussionResult:
    type: "object"
    location: "json"
    properties:
      success:
        location: "json"
        type: "boolean"
      discussion:
        location: "json"
        type: "object"

My testing model in BPMN.iO for ECA looks like this:

And this is what my action looks like:

The php error that I have mentioned above, occurs because I don't know how to send the users as an array. In the previous image I have tested with: [ "foo", "bar", "test" ]

🇲🇽Mexico ovilla

Thanks for the patch, I was trying to use the one in comment #31, but in my case I had a problem, because in my source site an image file is missing, then the migration was suddenly interrupted in the middle of the "focal_point_crop" migration, I received the following message:

Error: Call to a member function getFileUri() on null in Drupal\focal_point\Plugin\migrate\process\FocalPointToCropField->transform() (line 77 of /modules/contrib/focal_point/src/Plugin/migrate/process/FocalPointToCropField.php).
[warning] Drush command terminated abnormally.

In case someone has the same problem, I attach a fix for skipping rows where no image file is found.

🇲🇽Mexico ovilla

Here you go, a drush 12 generator compatible with DCG 3.

Please notice, there is a new path where the class file should be located (src/Drush/Generators) and the filename must end in Generator.php, see: https://www.drush.org/12.x/generators/

Usage:

With this patch applied, you must run command:

drush generate migrate_file_to_media:media_migration_generator:v3

or alias:

drush generate mf2m_media_v3

Production build 0.71.5 2024