Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve fatal error caused by "Price on Request" with similar estates. #786

Closed
3 tasks done
fredericalpers opened this issue Mar 25, 2024 · 2 comments · Fixed by #788
Closed
3 tasks done

Resolve fatal error caused by "Price on Request" with similar estates. #786

fredericalpers opened this issue Mar 25, 2024 · 2 comments · Fixed by #788
Assignees
Labels
bug Indicates an unexpected problem or unintended behaviour component: property detail page Issue, Pull Request or Discussion related to property detail page QA Issue or Pull request that is in review
Milestone

Comments

@fredericalpers
Copy link
Member

fredericalpers commented Mar 25, 2024

Resolve fatal error caused by "Price on Request" with similar estates.

Introduction

A bug has been identified in the similar estate feature, specifically affection properties marked with the “price on request” feature. This issue disrupts functionality of the similar estates, causing fatal errors in displaying relevant listings.

User Story

As a real estate agent utilizing the onOffice for WP-Websites plugin, I sometimes use the "Price on Request" feature when managing property listings. However, I encountered a fatal error when enabling this feature for similar estates. The error arises due to an undefined method being called.

This fatal error disrupts the functionality of the plugin and prevents users from effectively managing similar estates with the "Price on Request" feature enabled. To ensure a seamless user experience and maintain the stability of the plugin, I propose addressing this issue promptly.

By addressing this fatal error, we aim to enhance the reliability of the onOffice for WP-Websites plugin, allowing users to effectively utilize the "Price on Request" feature without encountering disruptive errors.

Error Log

Details

Fatal error: Uncaught Error: Call to undefined method onOffice\WPlugin\DataView\DataViewSimilarEstates::getListFieldsShowPriceOnRequest()
in /www/htdocs/w01dbd85/testinstanz-fal.onofficeweb.com/htdocs/wp-content/plugins/onoffice-for-wp-websites/plugin/EstateList.php on line 518

Call stack:

onOffice\WPlugin\EstateList::estateIterator()
wp-content/plugins/onoffice-for-wp-websites/templates.dist/estate/similar_estates.php:16
include()
wp-content/plugins/onoffice-for-wp-websites/plugin/Template.php:118
onOffice\WPlugin\Template::getIncludeContents()
wp-content/plugins/onoffice-for-wp-websites/plugin/Template.php:82
onOffice\WPlugin\Template::render()
wp-content/plugins/onoffice-for-wp-websites/plugin/Controller/EstateViewSimilarEstates.php:142
onOffice\W\C\EstateViewSimilarEstates::generateHtmlOutput()
wp-content/plugins/onoffice-for-wp-websites/plugin/EstateDetail.php:265
onOffice\WPlugin\EstateDetail::getSimilarEstates()
wp-content/plugins/onoffice-for-wp-websites/templates.dist/estate/default_detail.php:364
include()
wp-content/plugins/onoffice-for-wp-websites/plugin/Template.php:118
onOffice\WPlugin\Template::getIncludeContents()
wp-content/plugins/onoffice-for-wp-websites/plugin/Template.php:82
onOffice\WPlugin\Template::render()
wp-content/plugins/onoffice-for-wp-websites/plugin/Controller/ContentFilter/ContentFilterShortCodeEstateDetail.php:91
onOffice\W\C\C\ContentFilterShortCodeEstateDetail::render()
wp-content/plugins/onoffice-for-wp-websites/plugin/Controller/ContentFilter/ContentFilterShortCodeEstate.php:92
onOffice\W\C\C\ContentFilterShortCodeEstate::buildReplacementString()
wp-content/plugins/onoffice-for-wp-websites/plugin/Controller/ContentFilter/ContentFilterShortCodeEstate.php:69
onOffice\W\C\C\ContentFilterShortCodeEstate::replaceShortCodes()
wp-content/plugins/onoffice-for-wp-websites/plugin/Controller/ContentFilter/ContentFilterShortCodeRegistrator.php:59
onOffice\W\C\C\ContentFilterShortCodeRegistrator::onOffice\W\C\C\{closure}()
wp-includes/shortcodes.php:433
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/plugin.php:205
apply_filters()
wp-includes/post-template.php:256
the_content()
wp-content/themes/oceanwp/partials/page/article.php:20
require()
wp-includes/template.php:792
load_template()
wp-includes/template.php:725
locate_template()
wp-includes/general-template.php:206
get_template_part()
wp-content/themes/oceanwp/partials/page/layout.php:20
require()
wp-includes/template.php:792
load_template()
wp-includes/template.php:725
locate_template()
wp-includes/general-template.php:206
get_template_part()
wp-content/themes/oceanwp/page.php:36
include()
wp-includes/template-loader.php:106
require_once()
wp-blog-header.php:19
require()
index.php:17

Requirements / Tasks

  • Investigate the root cause of the fatal error triggered by enabling the "Price on Request" feature for similar estates.
  • Develop a fix to resolve the error and ensure proper functionality of the plugin when using the "Price on Request" feature.
  • Conduct thorough testing to verify that the fix resolves the fatal error and does not introduce any regressions.
@fredericalpers fredericalpers added bug Indicates an unexpected problem or unintended behaviour component: property detail page Issue, Pull Request or Discussion related to property detail page labels Mar 25, 2024
@fredericalpers fredericalpers added this to the v4.23 milestone Mar 25, 2024
@yeneastgate
Copy link
Contributor

@fredericalpers

  • Investigate the root cause of the fatal error triggered by enabling the "Price on Request" feature for similar estates.

When enabling the "Price on request" feature for similar estates will pass condition in this line

if ($recordRaw['preisAufAnfrage'] === DataListView::SHOW_PRICE_ON_REQUEST) {

So when you view "detail estate" page Which have show "similar estate" view, will run continue to the next line. At this line, $this->_pDataView(which is essentially DataViewSimilarEstates Class) is calling "getListFieldsShowPriceOnRequest" method. But this method has not been declared in this class

  • Develop a fix to resolve the error and ensure proper functionality of the plugin when using the "Price on Request" feature.

I fixed, I added "getListFieldsShowPriceOnRequest" method to "DataViewSimilarEstates" class

  • Conduct thorough testing to verify that the fix resolves the fatal error and does not introduce any regressions.

I checked that the "price on request" feature is only used on 3 screens: estate list, detail estate, and similar estate
=> We have been added the "getListFieldsShowPriceOnRequest" method for all.
This is demo video. Please check and let me know your opinion

Fixbug-price-on-request.mp4

@fredericalpers
Copy link
Member Author

@yeneastgate this seems to be working fine now. Thank you :)

@fredericalpers fredericalpers added the QA Issue or Pull request that is in review label Mar 28, 2024
@fredericalpers fredericalpers modified the milestones: v5.2, v5.1 Aug 2, 2024
@miauzjpg miauzjpg added deploy test Triggers event to create test version and removed deploy test Triggers event to create test version labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behaviour component: property detail page Issue, Pull Request or Discussion related to property detail page QA Issue or Pull request that is in review
Projects
None yet
3 participants