1
1
# --
2
2
# OTOBO is a web-based ticketing system for service organisations.
3
3
# --
4
- # Copyright (C) 2019-2024 Rother OSS GmbH, https://otobo.de /
4
+ # Copyright (C) 2019-2024 Rother OSS GmbH, https://otobo.io /
5
5
# --
6
6
# This program is free software: you can redistribute it and/or modify it under
7
7
# the terms of the GNU General Public License as published by the Free Software
@@ -111,7 +111,14 @@ sub Run {
111
111
my $InitialDynamicFieldConfig = $Kernel::OM -> Get(' Kernel::System::DynamicField' )-> DynamicFieldGet(
112
112
Name => $FieldName ,
113
113
);
114
- return unless IsHashRefWithData($InitialDynamicFieldConfig );
114
+ if ( !IsHashRefWithData($InitialDynamicFieldConfig ) ) {
115
+ return $LayoutObject -> JSONReply(
116
+ Data => {
117
+ Success => 0,
118
+ Messsage => qq{ Error reading the dynamic field '$FieldName '!} ,
119
+ },
120
+ );
121
+ }
115
122
116
123
# Check if we deal with a reference field
117
124
my $IsReferenceField = $DynamicFieldBackendObject -> HasBehavior(
@@ -129,7 +136,14 @@ sub Run {
129
136
$DynamicFieldConfig = $Kernel::OM -> Get(' Kernel::System::DynamicField' )-> DynamicFieldGet(
130
137
ID => $InitialDynamicFieldConfig -> {Config }{AttributeDF },
131
138
);
132
- return unless IsHashRefWithData($DynamicFieldConfig );
139
+ if ( !IsHashRefWithData($InitialDynamicFieldConfig ) ) {
140
+ return $LayoutObject -> JSONReply(
141
+ Data => {
142
+ Success => 0,
143
+ Messsage => qq{ Error reading the dynamic field '$FieldName '!} ,
144
+ },
145
+ );
146
+ }
133
147
134
148
$IsReferenceField = $DynamicFieldBackendObject -> HasBehavior(
135
149
DynamicFieldConfig => $DynamicFieldConfig ,
@@ -141,7 +155,7 @@ sub Run {
141
155
Data => {
142
156
Success => 0,
143
157
Messsage => qq{ Error reading the dynamic field '$FieldName '!} ,
144
- }
158
+ },
145
159
);
146
160
}
147
161
}
0 commit comments