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

DateTime issue in current 10.1. #547

Closed
svenoe opened this issue Oct 15, 2020 · 1 comment
Closed

DateTime issue in current 10.1. #547

svenoe opened this issue Oct 15, 2020 · 1 comment
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@svenoe
Copy link
Contributor

svenoe commented Oct 15, 2020

Currently, when trying to execute Maint::Cache::Delete e.g., I get the following error:
Initialization of state variables in list context currently forbidden at /media/sf_dev/otobo/otobo-dev/Kernel/System/DateTime.pm line 1619
And I'm not sure, for what reason we use state here.

@svenoe svenoe added the bug Something isn't working as intended label Oct 15, 2020
@svenoe svenoe added this to the OTOBO 10.1 milestone Oct 15, 2020
bschmalhofer added a commit that referenced this issue Oct 16, 2020
@bschmalhofer
Copy link
Contributor

state is used here as the modern replacement for the caching Variable %ValidTimeZones which was previously declared in file scope. The problem was that assignment of state hashes is only supported in Perl 5.28 or later. See https://www.effectiveperlprogramming.com/2018/08/initialize-array-and-hash-variables-with-state/.

I changed the implementation to using a scalar instead of a hash as the state variable. Closing the issue.

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

2 participants