Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug In SysConfig - Keys with ### do not work in the frontend (used in DynamicFieldScreens) #991

Closed
StefanRother-OTOBO opened this issue May 6, 2021 · 5 comments
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@StefanRother-OTOBO
Copy link
Contributor

Hi,

If I go to Admin -> System Configuration and click on Edit for the option "DynamicFieldScreens###Framework“ for example and then click on Save without making any changes, changes are still written. DynamicFieldSreens don't work anymore.

Thanks!

Stefan

@svenoe
Copy link
Contributor

svenoe commented May 6, 2021

Actually there are changes made - the keys are set to broken values. You can reset the setting to fix it, and you could put in every field by hand and it would work, but that is nonsense of course. I'll look where it comes from.

Edit: Slight correction - it wouldn't work. A part of the string is duplicated during pressing OK, basically...

@svenoe svenoe added the bug Something isn't working as intended label May 6, 2021
@svenoe
Copy link
Contributor

svenoe commented May 7, 2021

The error is produced in the js-part, Core.SysConfig.js line 429 (in Core.SysConfig.Update()):
FullName = FullName.substr(0, FullName.lastIndexOf("###"));
The "###" at the moment cannot be part of any hash key in the SysConfig. I assume it's the same in OTRS. A quick solution would be to change this to lastIndexOf("_Hash###"), but it's still not really clean. I want to at least consider some other possibilities, have to think about it, though...

@bschmalhofer bschmalhofer added this to the OTOBO 10.0 milestone Jul 3, 2021
@svenoe svenoe changed the title Bug In SysConfig Bug In SysConfig - Keys with ### do not work in the frontend (used in DynamicFieldScreens) Jan 10, 2022
@stefanhaerter
Copy link
Contributor

stefanhaerter commented Aug 5, 2022

Can it be assumed that the wanted FullName does not contain more than two occurrences of ###, like in DynamicFieldScreens###Framework_Hash###Ticket::Frontend::AgentTicketClose###DynamicField? Then maybe it could a possibility to do something like this:

FullName = FullName.substr(0, FullName.indexOf(FullName.firstIndexOf('###') + 1, '###'));

This would find the second occurrence of ###.

@stefanhaerter
Copy link
Contributor

stefanhaerter commented Jan 31, 2023

Another suggestion I thought of:

Replace

FullName = FullName.substr(0, FullName.lastIndexOf('###'));

with

FullName = FullName.substr(0, FullName.indexOf('###' + Key));

However, I currently do not fully understand the purpose of removing the key from the full name (which at the start includes the key, at least in the examples I tested), just to add it again.

Edit: This is about the following code section:

if($(this).parent().parent().hasClass("HashItem")) {
// update key name
Key = $(this).parent().parent().find(".Key").val();
FullName = FullName.substr(0, FullName.lastIndexOf("###"));
FullName += "###" + Key;
}

@stefanhaerter
Copy link
Contributor

Closed with merging #2533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

4 participants