Skip to content

[Bug]: Java Script names are incorrectly handled during export and when renaming/copying scripts #2364

Description

@speefak

I'm sure that

  • This issue is still present in the current beta version of this adapter
  • There is no other (open) issue with the same topic (use the search!)
  • This issue is not described in the adapter documentation / FAQ (read the docs!)

Script type

JavaScript

The problem

Bug: Script names are incorrectly handled during export and when renaming/copying scripts

I found two issues with script names in the Script Adapter, specifically with JavaScript scripts.

1. Script names are incorrectly exported

When exporting JavaScript scripts, the script name is not preserved correctly.

For example, the script:

PW-TV-Control_v0.6_VH_OG1

is exported with the filename:

6.json

instead of:

PW-TV-Control_v0.6_VH_OG1.json

Other examples from the screenshot show similar problems, where parts of the script name are lost or dots in version numbers are replaced with underscores.

For example:

PWSW-Master-Slave_v0.10_Büro

becomes:

PWSW-Master-Slave_v0_10_Büro.json

and:

HK-Balkontür_v0.1

becomes:

HK-Balkontür_v0_1

The most severe case is when only the version number is used as the filename, e.g. 6.json.

Expected behavior:

The complete script name should be preserved during export:

PW-TV-Control_v0.6_VH_OG1.json
PWSW-Master-Slave_v0.10_Büro.json
HK-Balkontür_v0.1.json

2. Renaming or copying a script automatically creates a folder

When renaming or copying a script, a new folder with the script name is automatically created, and the script is placed inside this folder.

Is there a possibility to change this behavior?

Ideally, renaming, creating, or copying a script should not automatically create a new folder. A folder should only be created when the user explicitly creates one.

Expected behavior:

  • Preserve the complete script name during export.
  • Do not replace . with _ in script names.
  • Do not export only parts of the script name, such as 6.json.
  • Do not automatically create a folder when renaming or copying a script.
  • Only create folders when explicitly requested by the user.

iobroker.current.log (in debug mode!)

No response

Version of nodejs

v22.23.2

Version of ioBroker js-controller

10.9.8 NPM?

Version of adapter

9.0.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions