onOffice-Web-Org / oo-wp-plugin

onOffice for WP-Websites
https://wp-plugin.onoffice.com
GNU General Public License v3.0
9 stars 9 forks source link

Improve the Plugins stability and reliability - Error handling fieldlists in similar estate #830

Open fredericalpers opened 1 month ago

fredericalpers commented 1 month ago

Improve the Plugins consistency - Error handling fieldlists in similar estate

Introduction

When removing all fields from the fieldlist in similar estates a fatal error will occur.

Details

Fatal error: Uncaught Error: onOffice\WPlugin\DataView\DataViewSimilarEstates::setFields(): Argument #1 ($fields) must be of type array, bool given, called in /www/htdocs/w01dbd85/testinstanz-fal.onofficeweb.com/htdocs/wp-content/plugins/onoffice-for-wp-websites/plugin/DataView/DataSimilarEstatesSettingsHandler.php on line 117 in /www/htdocs/w01dbd85/testinstanz-fal.onofficeweb.com/htdocs/wp-content/plugins/onoffice-for-wp-websites/plugin/DataView/DataViewSimilarEstates.php on line 162 Call stack: onOffice\W\D\DataViewSimilarEstates::setFields() wp-content/plugins/onoffice-for-wp-websites/plugin/DataView/DataSimilarEstatesSettingsHandler.php:117 onOffice\W\D\DataSimilarEstatesSettingsHandler::configureDataSimilarEstatesSettings() wp-content/plugins/onoffice-for-wp-websites/plugin/DataView/DataSimilarEstatesSettingsHandler.php:102 onOffice\W\D\DataSimilarEstatesSettingsHandler::createDataSimilarEstatesSettingsByValues() wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageSimilarEstates.php:299 onOffice\W\G\AdminPageSimilarEstates::save_form() wp-includes/class-wp-hook.php:324 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:348 WP_Hook::do_action() wp-includes/plugin.php:517 do_action() wp-admin/admin-post.php:85

User Story

Utilizing the onOffice for WP-Websites Plugin, I want the similar estates module to prevent critical errors when managing field lists, so that my website remains stable and user friendly. I want to be able to customize it without encountering critical errors. If I remove all fields from the field lists for e.g. esthetic design reasons, I need the plugin to be able to only display the properties image.

Tasks / Requirements

dai-eastgate commented 3 weeks ago

@fredericalpers I checked again and saw that in addition to similar estates, addresses list, estate list, and unit list also had this error. I fixed it and here is the evidence. Please check and let me know your opinion. Thanks!

https://github.com/onOffice-Web-Org/oo-wp-plugin/assets/106214469/a47cee7a-399f-4cdd-89da-ebdd2c41d50f

fredericalpers commented 3 weeks ago

@dai-eastgate thank you for fixing the other parts too :)