Skip to content

sourceResourceRoot is incorrect in event handlers #2965

@Daemant

Description

@Daemant

Describe the bug

Global variable sourceResourceRoot is okay when you call an exported function, but if you try to call the same function as event handler, sourceResourceRoot will unexpectedly become a dynamic map element of first resource.

Steps to reproduce

  1. Start both attached resources.
  2. Execute command runtest. Resource 1 will call resource 2 in two different ways: by export and by event.
  3. View clientscript log for results.
    Test resources.zip

Version

Client: v1.5.9-release-21630 (Windows 7, 64-bit)

Additional context

No response

Relevant log output

[2023-04-13 20:19:30] INFO: "thisRes"    resource[test_res1]
[2023-04-13 20:19:30] INFO: "thisRoot"    elem:resource9CF9C418

[2023-04-13 20:19:30] INFO: "export_test_2()"    "by export"
[2023-04-13 20:19:30] INFO: "source"    nil
[2023-04-13 20:19:30] INFO: "sourceResource"    resource[test_res1]
[2023-04-13 20:19:30] INFO: "sourceResourceRoot"    elem:resource4E3C2E68

[2023-04-13 20:19:30] INFO: "export_test_2()"    "by event"
[2023-04-13 20:19:30] INFO: "source"    elem:resource719E1E80
[2023-04-13 20:19:30] INFO: "sourceResource"    resource[test_res1]
[2023-04-13 20:19:30] INFO: "sourceResourceRoot"    elem:map62BE7A08

[2023-04-13 20:19:30] INFO: "eventCall"    true

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions