Drupal v9

The source Drupal v9 connector allows content, user, files and folders to be picked up from a Drupal v9 system and transformed into motation.

Specifics

Setup

To set up drupal 9 as a rest server for ImpulseSync to connect to there are a number of requirements to be met.

Configuration

A number of modules must be enabled.

Multilingual -> Content Translation

Multilingual -> Language

Web services -> HTTP Basic Authentication

Web services -> JSON:API

Web services -> RESTful Web Services

Web services -> Serialization

Endpoint Config

When saving an endpoint for a Drupal v9 repository via REST instead of the UI you must use the following key:value pairs in the payload.

  • contentRepo:drupal

  • contentRepoVersion:v9

Connector queries for child folders

Due to limitations of the rest API provided by the modules, the connector must manually filter out files that are in a child folder, rather than the current folder. This can cause picking up files to take longer than expected for a transaction that is picking up files with many files in child folders.

User reference field

Contents in Drupal 9 have both two user references built into them. uid and revision_uid. The uid field is used to create a relationship field to that user. The revision_uid field is not supported.

The user content has a content type user--user.

Language

The JSON:API does not have full support of languages. So there may be some limitations to language support.

Part of this is how/when the default language/translation is returned. If a language does not have a translation for a content, the default translation will be returned.

A field with the Drupal Link field type will be set as a Motation String field type with two values. The first value is the URL. The second value is the Link text. This allows for manipulators such as the Liquid field manipulator to access both values and manipulate them as necessary.

Number Field Type

All number field types are converted to a float value in Motation. This means that the value may require additional parsing to convert the number to the correct accuracy. i.e., the Number (integer) field type may have value of 7 in the system. But in Motation this is a value of 7.0000 with field type Float. The Liquid field manipulator can be used to "round" the value to an integer value for the destination connector.

Folders

A folder is created per folder in the path.

The entire folder path is dependent on if the files are hosted local to the system or not.

locally hosted

If they are local to the system, the folder path will be the the url path of the binary without the domain.

i.e., if an image has the url http://example.com/sites/default/files/2023-10/1.png then the full folder path will be sites/default/files/2023-10. This is then split into 4 separate folders.

  1. sites

  2. sites/default

  3. sites/default/files

  4. sites/default/files/2023-10

remote hosted

If they are not hosted local to the system, the folder path will be the url domain and the url path of the binary.

i.e., if an image has the url https://example.com/platform/files/public/2023-11/background/image.jpg?VersionId=LSxckf5AuOOHIr_fzRS4l1fbC6fMAJ99 Then the full folder path will be example.com/platform/files/public/2023-11/background. This is then split into 6 separate folders.

  1. example.com

  2. example.com/platform

  3. example.com/platform/files

  4. example.com/platform/files/public

  5. example.com/platform/files/public/2023-11

  6. example.com/platform/files/public/2023-11/background

Unsupported

Entity Reference field with non content target type. i.e., user, taxonomy, file, comment. Only entity reference to content is supported.

Comments are unsupported.

Comment field is unsupported.

Anonymous user is not picked up as it does not have all the required attributes. (i.e., changed)

User's picture field.

Field types from imported modules beyond what core Drupal v9 has.

The following list of fields are ignored not set as a field when transforming Drupal v9 content into Motation:

comment
node_type

Adapter Properties

PropertyPurpose

username

The username for authentication

password

The password for authentication

url

The URL the system's REST APIs are located at. i.e,. http://example.com

rateLimitPerSecond (optional)

The rate limit requests should be sent to the Drupal system. (default: 10)

Job Options

NameDescriptionData TypeRequiredDefault Value

contentType

The content type to pick up.

Text

true

No Default Value

folder

The folder path to pick up files from.

Text

false

No Default Value

languages

A '|' separated list of languages to pick up contents from

Text

false

No Default Value

query

Query params to add to the rest call to pick up content IDs with.

View JSON:API for additional details.

Text

false

No Default Value

contentType job option

The content type job option is the content type to pick up.

IMPULSE_ASSET keyword

The keyword IMPULSE_ASSET can be used in the contentType job option to pick up files.

IMPULSE_USER keyword

The keyword IMPULSE_USER can be used in the contentType job option to pick up users as a content.

folder job option

This option is paired with the IMPULSE_ASSET content type to limit the files picked up to a specific folder.

The folder job option is the folder to pick up files from.

language job option

This option is used to specify what translations (languages) of content should be picked up. It is a list of language codes separated by a pipe |. If you want to pick up the default language either pass the value DEFAULT_LANG or an empty value after a pipe.

Each language code will be set in the request path to get the language's translation of each content picked up. Be aware that the default language code may not be a valid to set in the request path, thus you may need to use theDEFAULT_LANG value.

query job option

The value set is query parameter(s) to add to the rest call made to the system to query for contents. View JSON:API doc for additional details and options.

Motation Object Support

ObjectSupported

Category

No

Definition

Yes

Domain

No

Folder

Yes

Language

No

Relationship

Yes

Tag

Yes

Last updated