-
Notifications
You must be signed in to change notification settings - Fork 72
Fixed issue with hiding conditions not hiding containers in simple ticket view #942
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
base: main
Are you sure you want to change the base?
Conversation
akstis-typer
commented
Apr 10, 2025
- It fixes Hiding fields depending on category does not work #847
Just to clarify: in my fresh installation (latest versions of everything), I had to place the code inside the $display_condition = new PluginFieldsContainerDisplayCondition(); like this: ...
$display_condition = new PluginFieldsContainerDisplayCondition();
// @akstis-typer code starts here ------
if($item->fields['type'] == "")
{
$item->fields['type'] = $params['options']['type'];
}
if($item->fields['itilcategories_id'] == "")
{
$item->fields['itilcategories_id'] = $params['options']['itilcategories_id'];
}
// @akstis-typer code ends here ------
if ($display_condition->computeDisplayContainer($item, $c_id)) {
... Otherwise, it didn’t work properly in my environment |
I've been testing this code and works correctly except for one more issue: When a custom field is shown and you edit another field (e.g. title), the custom field's alignment breaks again. My solution was to add $display_condition = new PluginFieldsContainerDisplayCondition();
if ($display_condition->computeDisplayContainer($item, $containers_id)) {
$field_options = [
'label_class' => 'col-lg-3',
'input_class' => 'col-lg-9',
];
echo "<div class='offset-md-1 col-md-8 col-xxl-6'>";
PluginFieldsField::showDomContainer(
$containers_id,
$item,
$type,
$subtype,
$field_options
);
echo "</div>";
} else {
echo '';
} After the |
can you rebase ? |
Hi, you mean I need to add last changes of original repository? Or something else? |
That should be sufficient. |
I think I did it right. The next step is unit tests - how do I make them? Or can I run yours? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You PR has lot of unrelated changes (new lines added, spacing added/removed) that must be reverted.
I've done poorly last time and accidentally revert changes in twig files. Now I reverted all back how it should be and removed spaces and new lines I added. |
Rebased myself to upstream main branch Edited only two files: -container.php that fixes formatting of field -field.class.php that fixes issue with field not respecting hiding condition in simple view
Finally I got it |
We currently have no tests on this plugin; but we will work on adding some quickly. For now, you cannot add tests for your changes; we'll ping you. Until that, we asked feedback from several users to know if their issues are resolved by your changes. Thanks a lot for your worK. |
=
I tested it and in my environment it only worked correctly this way. Thank you very much everyone! |