From 387d3d64abef39a6d5b61ec3859d9ab4e667b6a8 Mon Sep 17 00:00:00 2001
From: Kevin Ditscheid <kevin.ditscheid@sgalinski.de>
Date: Thu, 6 Dec 2018 12:30:00 +0100
Subject: [PATCH] [BUGFIX] Limit department select to the language of the job

This commit adds a limit to the language of the job into the department
select field. This way no departments can be selected, that are not the
same language as the job itself. It also adds a sorting to make the
list easier to read.
---
 Configuration/TCA/tx_sgjobs_domain_model_job.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job.php b/Configuration/TCA/tx_sgjobs_domain_model_job.php
index b1794d5a..017efc1c 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_job.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_job.php
@@ -160,6 +160,7 @@ return [
 				'type' => 'select',
 				'renderType' => 'selectSingle',
 				'foreign_table' => 'tx_sgjobs_domain_model_department',
+				'foreign_table_where' => ' AND (tx_sgjobs_domain_model_department.sys_language_uid=###REC_FIELD_sys_language_uid### OR tx_sgjobs_domain_model_department.sys_language_uid=-1) ORDER BY tx_sgjobs_domain_model_department.sorting ASC',
 				'minitems' => 1,
 				'items' => [
 					[
-- 
GitLab