8000 Cannot Rename Custom Fields such as Button · Issue #24158 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cannot Rename Custom Fields such as Button #24158
Closed
@aldo-o

Description

@aldo-o

Description of the issue

I updated to version 15 and I had to create some Custom Fields, a Button to be precise. As always I use Customize Form. But seems like some months ago a new push ( #21355 ) add prefix custom_ . So what I tried to do after creating the field, I went to Custom Fields doctype and tried to Rename Fieldname. But it throws an error because it's also trying to rename it in database, which is does not exists.

Context information (for bug reports)

Output of bench version

frappe 15.8.1
erpnext 15.9.1

Steps to reproduce the issue

  1. Create a button in any doctype (I tried in Sales Order) via Customize Form and save.
  2. Go to Custom Field doctype and open the newly created button.
  3. Click Rename Fieldname top right button and try to rename it.

Observed result

It throws IndexError: list index out of range

Expected result

Fieldname of button to be renamed.

Stacktrace / full error message

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1689, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 364, in rename_fieldname
    frappe.db.rename_column(parent_doctype, old_fieldname, new_fieldname)
  File "apps/frappe/frappe/database/mariadb/database.py", line 258, in rename_column
    current_data_type = self.get_column_type(doctype, old_column_name)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/mariadb/database.py", line 346, in get_column_type
    frappe.qb.from_(information_schema.columns)
IndexError: list index out of range

Additional information

OS version / distribution, Frappe install method, etc.

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

      0