Skip to content

"Failed to save link" toast but still saves #349

@purplespider

Description

@purplespider

Module version(s) affected

4.0.8

Description

Upon clicking "Save" when adding any link, a toast appears stating "Failed to save link" and the modal stays on screen.

However, upon refreshing the page, the link appears in the list, so it was saved.

Screenshot 2024-11-14 at 11 39 53

Works fine locally, issue only occurs once deployed.

No errors in console and no fetch errors.

The only thing different I can see, between when it works locally, and doesn't work on production is locally, after the fetch request to admin/linkfield/linkForm/0 there are two more fetch requests (to admin/linkfield/linkForm/13/field/PageID/tree and admin/linkfield/data) netiher of which appear when doing a save on production.

Things tried:

  • Different PHP versions
  • Flushing & dev/build

How to reproduce

private static $has_many = [
     'HeaderButtons' => Link::class . '.Owner',
];

//...
    $fields->addFieldToTab('Root.Main', MultiLinkField::create('HeaderButtons'));
//...

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions