BelongsTo relationship fields lose data when saved if hidden in filterFields()
Refs octobercms/october#3568
I am able to reproduce it into the test plugin following the original author guidelines.
I found that when disabled/hidden from the model using listFields methods, the relation widgets (tested on recordfinder and basic relation widget) get the wrong formField config in getSaveValue which probably cause this issue:
- inside
getSaveValue:->formField->hidden(or disabled) are always false - this makes them return null (and not
FormField::NO_SAVE_DATA) - this
nullreturned is causing the "null saving" into the database here: https://github.com/wintercms/winter/blob/32440b19b92eeaaefaa0478d5170101e6cf1113e/modules/backend/traits/FormModelSaver.php#L77-L81
I just can't get atm when inside the saving process: the field which is initialized at hidden/disabled = true, lost his state to retrieve its default.
Also, is that normal that the record finder never return FormField::NO_SAVE_DATA? This will probably make this bug persist even if we fix the initial cause.
Réf: https://github.com/wintercms/winter/blob/develop/modules/backend/formwidgets/RecordFinder.php#L242-L245
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at [email protected].
This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at [email protected].
This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at [email protected].