dkan
dkan copied to clipboard
Multilingual Content Translation
Describe the bug
I am trying to install DKAN with multi-lingual support for content so I used DKAN-tools to have a quick development environment and I installed "Language" and "Content Translation" modules.
This allowed me to write translated content/metadata for the datafiles/dataset, however once I click save in the translated screen, the content page crash on me and I received the following message "The website encountered an unexpected error. Please try again later."
The docker logs show me the following error:
192.168.192.4 - - [26/May/2021:10:12:48 +0000] "GET /ar/admin/content/datasets HTTP/1.1" 500 74
[Wed May 26 10:12:49.392797 2021] [proxy_fcgi:error] [pid 8:tid 139627012802304] [client 192.168.192.4:49810] AH01071: Got error 'PHP message: TypeError: Argument 2 passed to Drupal\\metastore\\Reference\\Dereferencer::dereferenceSingle() must be of the type string, object given, called in /var/www/docroot/modules/contrib/dkan/modules/metastore/src/Reference/Dereferencer.php on line 98 in /var/www/docroot/modules/contrib/dkan/modules/metastore/src/Reference/Dereferencer.php on line 121 #0 /var/www/docroot/modules/contrib/dkan/modules/metastore/src/Reference/Dereferencer.php(98): Drupal\\metastore\\Reference\\Dereferencer->dereferenceSingle('distribution', Object(stdClass))\n#1 /var/www/docroot/modules/contrib/dkan/modules/metastore/src/Reference/Dereferencer.php(66): Drupal\\metastore\\Reference\\Dereferencer->dereferenceMultiple('distribution', Array)\n#2 /var/www/docroot/modules/contrib/dkan/modules/metastore/src/Reference/Dereferencer.php(45): Drupal\\metastore\\Reference\\Dereferencer->dereferenceProperty('distribution', Array)\n#3 /var/www/docroot/modules/contrib/dkan/modules/metastore/src/LifeCycle/Data.php(61): Drupal\\metastore\\Refe...', referer: http://dkan.mmjabr.com/ar/node/4/translations/add/en/ar
I am running DKAN from dkan-tools. Drupal: 9.0.13 PHP: 7.3.15 Apache: 2.4.18 DKAN: 2.10.3 DKAN-tools: 4.2.2
Steps To Reproduce
1- Install Language and Content Translation modules 2- Add second language in the Language module 3- Enable content translation for data 4- Add new dataset or edit an existing one, fill all metadata and save 5- Edit the newly added dataset and click the translate tab 6- Fill some of the translated metadata and click save 7- This were content page crash and I had to delete the website and install it again
Expected behavior
1- To be able to save the translated content 2- View the translated content depending on which language I am viewing the website at
Images to make things easier
Step 1:
Step 2:
Step 3:
Step 4:
Step5:
Step7 (The error message):