-
Notifications
You must be signed in to change notification settings - Fork 78
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -887,6 +887,12 @@ public static function showForTab($params) | |||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| $item = $params['item']; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if ($item->fields['type'] == "") { | ||||||||||||||||||||||||||
| $item->fields['type'] = $params['options']['type']; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| if ($item->fields['itilcategories_id'] == "") { | ||||||||||||||||||||||||||
| $item->fields['itilcategories_id'] = $params['options']['itilcategories_id']; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+890
to
+895
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Can you test with a non-ITIL item (e.g. |
||||||||||||||||||||||||||
| $functions = array_column(debug_backtrace(), 'function'); | ||||||||||||||||||||||||||
| $subtype = isset($_SESSION['glpi_tabs'][strtolower($item::getType())]) ? $_SESSION['glpi_tabs'][strtolower($item::getType())] : ''; | ||||||||||||||||||||||||||
| $type = substr($subtype, -strlen('$main')) === '$main' | ||||||||||||||||||||||||||
|
|
@@ -956,7 +962,7 @@ public static function showForTab($params) | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| $html_id = 'plugin_fields_container_' . mt_rand(); | ||||||||||||||||||||||||||
| if (strpos($current_url, 'helpdesk.public.php') !== false) { | ||||||||||||||||||||||||||
| if (strpos($current_url, 'helpdesk.public.php') !== false || strpos($current_url, 'tracking.injector.php') !== false) { | ||||||||||||||||||||||||||
| echo "<div id='{$html_id}' class='card-body row mx-0' style='border-top:0'>"; | ||||||||||||||||||||||||||
| echo "<div class='offset-md-1 col-md-8 col-xxl-6'>"; | ||||||||||||||||||||||||||
| $field_options = [ | ||||||||||||||||||||||||||
|
|
@@ -976,7 +982,7 @@ public static function showForTab($params) | |||||||||||||||||||||||||
| $field_options ?? [], | ||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| if (strpos($current_url, 'helpdesk.public.php') !== false) { | ||||||||||||||||||||||||||
| if (strpos($current_url, 'helpdesk.public.php') !== false || strpos($current_url, 'tracking.injector.php') !== false) { | ||||||||||||||||||||||||||
| echo '</div>'; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| echo '</div>'; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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.
This wrapper is now always applied on AJAX refresh, but
showForTab(inc/field.class.php:965-974) only applies it forhelpdesk.public.php/tracking.injector.php. Normal admin/agent forms load with no wrapper, then get re-wrapped as soon as any field changes ; fields shift after the first edit. Matches misalignment reports on the PR thread (e.g. leeopereira, 2025-08-28).Should this only apply when
$type/$subtypematches the public/injector context, likeshowForTab?