Drupal v9
Last updated
Last updated
The source Drupal v9 connector allows content, user, files and folders to be picked up from a Drupal v9 system and transformed into motation.
To set up drupal 9 as a rest server for ImpulseSync to connect to there are a number of requirements to be met.
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
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
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.
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
.
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.
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.
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.
If they are local to the system, the folder path will be the the url path of the binary without the domain.
sites
sites/default
sites/default/files
sites/default/files/2023-10
If they are not hosted local to the system, the folder path will be the url domain and the url path of the binary.
example.com
example.com/platform
example.com/platform/files
example.com/platform/files/public
example.com/platform/files/public/2023-11
example.com/platform/files/public/2023-11/background
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:
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)
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.
Text
false
No Default Value
The content type job option is the content type to pick up.
The keyword IMPULSE_ASSET can be used in the contentType job option to pick up files.
The keyword IMPULSE_USER can be used in the contentType job option to pick up users as a content.
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.
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.
Category
No
Definition
Yes
Domain
No
Folder
Yes
Language
No
Relationship
Yes
Tag
Yes
i.e., if an image has the url
then the full folder path will be sites/default/files/2023-10
. This is then split into 4 separate folders.
i.e., if an image has the url
Then the full folder path will be example.com/platform/files/public/2023-11/background
. This is then split into 6 separate folders.
View for additional details.
The value set is query parameter(s) to add to the rest call made to the system to query for contents. View doc for additional details and options.