silverstripe / silverstripe-linkfield

Silverstripe module for managing links
BSD 3-Clause "New" or "Revised" License
4 stars 15 forks source link

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

Open purplespider opened 2 days ago

purplespider commented 2 days ago

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:

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

GuySartorelli commented 1 day ago

Works fine locally, issue only occurs once deployed.

Can you please try to find a way to reproduce this locally? If we can't reproduce it, we can't fix it. Clearly the information you provided in "How to reproduce" won't be sufficient on its own.

purplespider commented 1 day ago

Yeah, I appreciate that, Guy. With no errors in the console, I'm a bit stumped, though. I was hoping someone familiar with the module may have some ideas for areas to investigate that could be causing the "Failed" message to trigger. Thanks.