Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.04k stars 885 forks source link

fix warn before leaving - remove backpack dynamic inputs from serialization #5560

Closed pxpm closed 1 month ago

pxpm commented 1 month ago

WHY

BEFORE - What was wrong? What was happening before this PR?

Reported in: https://github.com/Laravel-Backpack/CRUD/issues/5370

The warnBeforeLeaving setting in create/update operation would "trigger" the warning in unwanted situations, for example in case the form had tabs, if user opens the page, change the tab and try to leave the page without touching any field, the "prevention script" would wrongly warn the user.

That was due to attributes like _current_tab.

AFTER - What is happening after this PR?

The script removes all fields from the form serialization that start with _ (underscore).

Is it a breaking change?

I don't think so no, there was a bug we are fixing.

tabacitu commented 1 month ago

Sounds good to me.