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

fix: field wildcard for child object #26543

Merged
merged 1 commit into from
May 24, 2024
Merged

fix: field wildcard for child object #26543

merged 1 commit into from
May 24, 2024

Conversation

klahap
Copy link
Contributor

@klahap klahap commented May 23, 2024

Hi,

When loading child objects with fields=["*"] via the REST API, only standard fields are returned. india081947 has already described the same bug in #25441.

Example

request: {{base-url}}/api/resource/Web Form Field?fields=["*"]&parent=Web Form

function trace:

  1. frappe.api.v1.document_list
  2. frappe.client.get_list : here the parent-doctype-name is saved with the key "parent_doctype"
  3. frappe.desk.reportview.validate_args
  4. frappe.desk.reportview.validate_fields
  5. frappe.desk.reportview.update_wildcard_field_param : here the parent-doctype-name is loaded with the key "parenttype", but this key does not exist -> None

response with bug

{
    "data": [
        {
            "name": "e3bn1at0sb",
            "owner": "Administrator",
            "creation": "2016-09-19 05:16:59.242754",
            "modified": "2024-04-25 18:05:49.539971",
            "modified_by": "Administrator",
            "docstatus": 0,
            "idx": 1
        }
    ]
}

response without bug

{
    "data": [
        {
            "name": "e3bn1at0sb",
            "owner": "Administrator",
            "creation": "2016-09-19 05:16:59.242754",
            "modified": "2024-04-25 18:05:49.539971",
            "modified_by": "Administrator",
            "docstatus": 0,
            "idx": 1,
            "parent": "edit-profile",
            "parentfield": "web_form_fields",
            "parenttype": "Web Form",
            "fieldname": "first_name",
            "fieldtype": "Data",
            "label": "First Name",
            "allow_read_on_all_link_options": 0,
            "reqd": 1,
            "read_only": 0,
            "show_in_filter": 0,
            "hidden": 0,
            "options": null,
            "max_length": 0,
            "max_value": 0,
            "precision": null,
            "depends_on": null,
            "mandatory_depends_on": null,
            "read_only_depends_on": null,
            "description": null,
            "default": null
        }
    ]
}

@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label May 23, 2024
@klahap klahap changed the title BUG field wildcard for child object fix: field wildcard for child object May 23, 2024
@ankush ankush enabled auto-merge (squash) May 24, 2024 10:18
@ankush ankush added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels May 24, 2024
@ankush ankush merged commit 6b0d9e4 into frappe:develop May 24, 2024
23 of 24 checks passed
mergify bot pushed a commit that referenced this pull request May 24, 2024
mergify bot pushed a commit that referenced this pull request May 24, 2024
(cherry picked from commit 6b0d9e4)

# Conflicts:
#	frappe/desk/reportview.py
ankush pushed a commit that referenced this pull request May 24, 2024
(cherry picked from commit 6b0d9e4)

Co-authored-by: KlausH09 <44837058+KlausH09@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request May 28, 2024
# [15.29.0](v15.28.0...v15.29.0) (2024-05-28)

### Bug Fixes

* Appropriate variable name, avoid redefining parameter ([a75c031](a75c031))
* child table field wildcard in API ([#26543](#26543)) ([#26560](#26560)) ([20ac585](20ac585))
* Drop file_manager.download_file ([#26575](#26575)) ([#26577](#26577)) ([6ace16b](6ace16b))
* ignore apps without pyproject ([#26498](#26498)) ([#26503](#26503)) ([6c3c798](6c3c798))
* reload before saving on reconnect ([#26534](#26534)) ([#26537](#26537)) ([22e278f](22e278f))
* Use true stderr for dumping trace ([#26524](#26524)) ([#26527](#26527)) ([e7e55db](e7e55db))

### Features

* Add `on_add_row` event for grid in Dialog ([e592b87](e592b87))
* ignore `tar: file changed as we read it` during backups (backport [#26462](#26462)) ([#26495](#26495)) ([30f767e](30f767e))
* Option to make webform embeddable ([f08fff5](f08fff5))

### Performance Improvements

* Avoid coalesce for `between` filters ([#26531](#26531)) ([#26532](#26532)) ([8263898](8263898))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants