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 - Default popup profile doesn't work because of a number check where a string is given #634

Open
tipue-dev opened this issue Jan 29, 2025 · 0 comments

Comments

@tipue-dev
Copy link
Contributor

Environment

  • Server OS: n.a.
  • Browser: n.a.
  • Znuny version: 7.1.13 (problem exists since Aug 2, 2023)

Expected behavior

When loading a page, the popup profile in the system configuration should determine the correct size of the popup window, if the user never changes to popup size manually.

Actual behavior

For new agents, or agents that never changes the popup size manually, the default values for popup size and position don't work.

The configuration Frontend::PopupProfiles###001-Framework contains sizes with '%' and 'px'.
When those are used in the javascript, it is first checked if the content is a number
PopupProfiles[PopupProfile].Width = Number(PopupProfiles[PopupProfile].Width); this has been done by the PR #433. This is in conflict with the prior change from commit# a37e327. Here, the configuration added '%' and 'px' to the Profile and a RegEx check for those characters. But this is done after the content is checked for being a number.

After the popup size is changes manually, the user_preferences table contains new values without strings, so it is correctly interpreted as pixel (which also only makes sense if the agent always works on the same/similar monitor. This has nothing to do with this bug, but maybe this could be improved in the future)

How to reproduce

Steps to reproduce the behavior:

  • Create a new user (or delete the popup preferences of an existing user from the user_preferences table)
  • Open Agent TicketZoom and paste Core.UI.Popup.ProfileList() into the console. You will see the default profile with values containing '%' and 'px'.
  • Open any Popup and close is again. Still in AgentTicketZoom, without reloading, execute Core.UI.Popup.ProfileList() again.
  • You will see, that all entries now contain NaN as values.

Screenshots

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant