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

Can't import back scheme with selection column #1376

Open
Abyss777 opened this issue Sep 23, 2024 · 1 comment · May be fixed by #1383
Open

Can't import back scheme with selection column #1376

Abyss777 opened this issue Sep 23, 2024 · 1 comment · May be fixed by #1383
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@Abyss777
Copy link

Steps to reproduce

  1. Create table with selection column
  2. Export scheme to json file
  3. Create new table and import scheme back

Expected behavior

New table created with scheme from file

Actual behavior

Nothing happens in GUI. And there is a Error in log:

"File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 170,
    "Previous": {
      "Exception": "TypeError",
      "Message": "OCA\\Tables\\Dto\\Column::__construct(): Argument #15 ($selectionOptions) must be of type ?string, array given, called in /var/www/html/custom_apps/tables/lib/Controller/ApiTablesController.php on line 145",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/html/custom_apps/tables/lib/Controller/ApiTablesController.php",
          "line": 145,
          "function": "__construct",
          "class": "OCA\\Tables\\Dto\\Column",
          "type": "->",
          "args": [
            "Статус",
            "selection",
            "",
            true,
            "",
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            "",
            "",
            [
              [
                0,
                "в ожидании"
              ],
              [
                1,
                "подготовка"
              ],
              [
                2,
                "в процессе"
              ],
              [
                3,
                "готово"
              ],
              [
                4,
                "отказ"
              ]
            ],
            "null",
            null,
            "",
            null,
            null,
            null,
            null
          ]
        },

Tables app version

0.8.0

Browser

Firefox 130.0.1

Client operating system

ubuntu 22.04

Operating system

ubuntu 22.04

Web server

Apache

PHP engine version

PHP 8.2

Database

MySQL

Additional info

Here is the exported column from json

    {
      "id": 6,
      "tableId": 2,
      "title": "Статус",
      "createdBy": "584F3634-8D75-4B67-9FB2-CB0F48EB305E",
      "createdByDisplayName": "...",
      "createdAt": "2024-09-16 12:29:19",
      "lastEditBy": "584F3634-8D75-4B67-9FB2-CB0F48EB305E",
      "lastEditByDisplayName": "...",
      "lastEditAt": "2024-09-19 13:42:34",
      "type": "selection",
      "subtype": "",
      "mandatory": true,
      "description": "",
      "numberDefault": null,
      "numberMin": null,
      "numberMax": null,
      "numberDecimals": null,
      "numberPrefix": "",
      "numberSuffix": "",
      "textDefault": null,
      "textAllowedPattern": null,
      "textMaxLength": null,
      "selectionOptions": [
        {
          "id": 0,
          "label": "в ожидании"
        },
        {
          "id": 1,
          "label": "подготовка"
        },
        {
          "id": 2,
          "label": "в процессе"
        },
        {
          "id": 3,
          "label": "готово"
        },
        {
          "id": 4,
          "label": "отказ"
        }
      ],
      "selectionDefault": "null",
      "datetimeDefault": null,
      "usergroupDefault": [],
      "usergroupMultipleItems": null,
      "usergroupSelectUsers": null,
      "usergroupSelectGroups": null,
      "showUserStatus": null
    },

selectionOptions is array of objects, not string

@Abyss777 Abyss777 added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Sep 23, 2024
@enjeck enjeck linked a pull request Sep 28, 2024 that will close this issue
@enjeck
Copy link
Contributor

enjeck commented Sep 28, 2024

Should be fixed with #1383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants