Skip to content
Snippets Groups Projects
Verified Commit 88cafd1b authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

fix: return empty data if no fields added to form

parent be343b56
No related branches found
No related tags found
2 merge requests!28release: 3.0.0,!19Add strong typing for 3.0 version
Pipeline #6741 passed with stages
in 2 minutes and 14 seconds
......@@ -180,6 +180,10 @@ class FormWithFields implements Form, ContainerForm, FieldProvider {
}
public function get_data(): array {
if ( empty( $this->get_fields() ) ) {
return [];
}
$data = $this->updated_data;
foreach ( $this->get_fields() as $field ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment