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 - Dynamic field is not displayed propertly in Dashboard if set in 1st position and metaitems are disabled #593

Open
BuilderNSV opened this issue Sep 9, 2024 · 4 comments
Assignees
Labels
4 - wontfix This will not be worked on.

Comments

@BuilderNSV
Copy link
Contributor

Environment

  • Server OS: Linux
  • Browser: Firefox
  • Znuny version: 7.1.2

Expected behavior

If metainformation is disabled and dashboard's widget is configured to display dynamic field as 1st column, dynamic field's values should be displayed correctly.

Actual behavior

If metainformation is disabled and dashboard's widget is configured to display dynamic field as 1st column, Dynamic field's name is displayed as column name but all values from next columns are shifted to on 1 column left. Dynamic field's values are not displayed.

How to reproduce

Steps to reproduce the behavior:

  1. Create a ticket related dynamic field .
  2. Create one or more tickets with filled dynamic field.
  3. Configure, as example, 'Open Tickets' dashboard widget to display dynamic field in 1st column
  4. See on the 'Open Tickets' widget that values of dynamic field are displayed correctly (see 'Correct view' in screenshots)
  5. Go to Kernel/Output/HTML/Layout/Ticket.pm and change code so that TicketMetaItemsCount() and TicketMetaItems() functions return (). (empty array)
  6. See on the 'Open Tickets' widget that values of dynamic field are displayed incorrectly - all values from next columns are shifted left (see 'Incorrect view' in screenshots).

Screenshots

Correct view
correct
Incorrect view
incorrect

@hanneshal
Copy link

Hi @BuilderNSV

the reason for that is, that the render blocks are still triggered.
No Dashboard/TicketGeneric widget is able to do this by default. You need to modify code, and I think we can agree here, if you get errors / wrong behaviour after you made modifications to the code, it is not really a bug ;)

The template blocks (th and td) for this specific meta information are rendered and with your change you just reduced the data sent to the template.

This is not a bug in the framework. As long as ContentLargeTicketGenericHeaderMeta is rendered in the template, this will happen.

if you need a specific widget stlye, I suggest you create your own template for the widget and use the custom folder to deploy it.

Regards
Johannes

@hanneshal hanneshal self-assigned this Sep 10, 2024
@hanneshal hanneshal added the 4 - wontfix This will not be worked on. label Sep 10, 2024
@BuilderNSV
Copy link
Contributor Author

Hi @hanneshal,

Thanks for detailed answer I have missed dependence from metainfo in template.

Best wishes,
Sergey

@BuilderNSV
Copy link
Contributor Author

@hanneshal,

It's me again. Please let me don't agree with you about template specific problem on my side. I've analyzed problem deeper and see that template modification is not required.
Value of dynamic field is not displayed in table because someone forgot to add block initialization before output dynamic field value
$LayoutObject->Block( Name => 'GeneralOverviewRow', );
see Kernel\Output\HTML\Dashboard\TicketGeneric.pm, line 2005 - in that 'else' section this block is not initialized and value is not displayed but I can't understand how value is rendered if dynamic field is not in 1st position

Best wishes,
Sergey

@BuilderNSV
Copy link
Contributor Author

Hi @hanneshal,
What about my last comment, do you agree with me?

Best wishes,
Sergey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - wontfix This will not be worked on.
Development

No branches or pull requests

2 participants