https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44067

            Bug ID: 44067
           Summary: Unable to Save Agreements with related records with
                    notes field
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P5 - low
         Component: ERM
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected],
                    [email protected],
                    [email protected],
                    [email protected],
                    [email protected]
  Target Milestone: ---

# Description

When linking an existing agreement to another agreement and entering
information in the **Notes** field, saving the agreement may fail with the
following error:

```json
{
  "message": "Properties not allowed: _strings.",
  "path": "/body/agreement_relationships/0"
}
```

The error indicates that the API rejects an unexpected property named
`_strings` within the first object of the `agreement_relationships` array.

## Observed Payload

The submitted payload contains the following structure:

```json
{
  "agreement_relationships": [
    {
      "_strings": {},
      "agreement_id": 2,
      "notes": "",
      "related_agreement_id": 1,
      "relationship": "supersedes"
    }
  ]
}
```

The `_strings` property appears to be an unexpected frontend-generated property
that is included in the serialized API request.

The API schema does not allow `_strings` within an `agreement_relationships`
record.

## Steps to Reproduce

1. Create a new agreement (Agreement A1).
2. Create a second agreement (Agreement A2).
3. Navigate back to Agreement A1 and open it in Edit mode.
4. Link Agreement A2 to Agreement A1.
5. Enter some text in the **Notes** field of the relationship.
6. Save the agreement.

**Note:** If the issue does not occur immediately, repeat the steps several
times and try linking multiple agreement records with notes.

## Expected Result

The agreement should be saved successfully, including the relationship and its
associated notes.

## Actual Result

Saving the agreement fails with the following API validation error:

`Properties not allowed: _strings.`

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to