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

Error handling deleted or incorrectly selected templates #698

Open
4 tasks done
fredericalpers opened this issue Dec 7, 2023 · 7 comments · May be fixed by #727
Open
4 tasks done

Error handling deleted or incorrectly selected templates #698

fredericalpers opened this issue Dec 7, 2023 · 7 comments · May be fixed by #727
Assignees
Labels
component: contact form Issue, Pull Request or Discussion related to contact forms component: interest form Issue, Pull Request or Discussion related to interest forms component: owner form Issue, Pull Request or Discussion related to owner forms component: property detail page Issue, Pull Request or Discussion related to property detail page component: property list Issue, Pull Request or Discussion related to property lists component: unit list Issue, Pull Request or Discussion related to unit lists feature New feature QA Issue or Pull request that is in review UI/UX Issue, Pull Request or Discussion related to UI/UX

Comments

@fredericalpers
Copy link
Member

fredericalpers commented Dec 7, 2023

Initiative

Improve error handling for templates in the onOffice for WP-Websites Plugin for a better user experience.

Epic

Implement error messages for deleted, incorrectly selected or renamed templates.

User story

As a real estate agent utilizing the onOffice for WP-Websites plugin, I am faced with critical issues when a chosen template is deleted, incorrectly selected or renamed. Currently, this situation leads to a critical error on the frontend, causing potential disruptions to the user experience. To mitigate this, I require a robust error handling mechanism that notifies me when a template is deleted, when a incorrect template is chosen or a template is renamed. This way, I can promptly address any issues and ensure the seamless functioning of my real estate website.

Templates play a pivotal role in shaping the presentation of property listings on my website. However, the current lack of error handling creates a vulnerability where the deletion of a template, an incorrect selection or renaming can lead to critical erros on the frontend. To enhance the plugin's reliability, a comprehensive error handling system needs to be implemented.

Tasks

  • Create a fallback mechanism that, in the absence of the chosen template, automatically selects a default template to prevent critical erros on the frontend.
  • Implement a mechanism that detects when a template used in the onOffice for WP-Websites Plugin is deleted, either through theme or plugin updates.
  • Integrate a notification system that alerts administrators or users about the deleted template, providing guidance on resolution.
  • Develop a clear and informative error message that is displayed in the WP backend when a template used by the plugin is deleted or a wrong template chosen.

Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?

The active template for [Property list ListName] has been deleted. Please select a new template.

The template "TemplateName" is not compatible with property lists. Please select the default template "default.php" or a new template.

The template "TemplateName" is not compatible with property detail pages. Please select the default template "default_detail.php" or a new template.

The template "TemplateName" is not compatible with the form type "FormTypeName". Please select the standard template "TemplateName" or a new template of type "FormTypeName".

By implementing this error handling mechanism, the onOffice for WP-Websites plugin can enhance its resilience, providing real estate agents with a more reliable and stable platform for showcasing their property listings etc.

@fredericalpers fredericalpers added this to the v4.20 milestone Dec 7, 2023
@dai-eastgate
Copy link
Contributor

@fredericalpers

  1. For this notification "Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?"
  • Behavior:
    Delete any templates in the "templates.dist" or the "onoffice-personalized" folder.
    => Screen shows notification:
    Because we cannot catch the behavior of the user. When users delete template files, we can only check which template files have been deleted in the "templates.dist" folder or "onoffice-personalized" folder.
    => So in my opinion:
    When we access the following screens, the notification will display:
    "Add new" or "Duplicate" or "Reload/ Redirect" a "List View" or "Form"?
  1. For this notification "The active template for [Property list ListName] has been deleted. Please select a new template."
  • Behavior:
    Go to the screen "Edit List view" or "Edit Form" => See the "active template" for [Property list ListName] or [Form] But this "active template" has been deleted in the "templates.dist" folder or "onoffice-personalized" folder.
    => Screen shows notification:
    "Duplicate" or "Reload/ Redirect" or click the "Save changes" button in "edit list view" or "edit form" by a specific ID.
  1. For this notification: "The template "TemplateName" is not compatible with property lists. Please select the default template "default.php" or a new template."
  • Behavior:
    Go to the screen "Edit List view" => Choose another template different from the "default.php" template => Click the "Save changes" button
    => Screen shows notification: "Edit List view"
  1. For this notification: “The template "TemplateName" is not compatible with property detail pages. Please select the default template "default_detail.php" or a new template”
  • Behavior of users:
    Go to the screen "Edit Detail View" => Choose another template different from "default_detail.php" => Click the "Save changes" button
    => Screen shows notification: "Edit Detail View"
  1. For this notification: “The template "TemplateName" is not compatible with the form type "FormTypeName". Please select the standard template "TemplateName" or a new template of type "FormTypeName" ”
  • Behavior:
    Go to the screen edit of any Form => Choose another template different from the "default template of that form" => Click the "Save changes" button
    => Screen shows notification: Edit "Form"

Additionally, I noticed that you mentioned "renamed templates" in the requirements.
As I understand it, it means the following:

  • Behavior: Go to the screen "Edit List view" or "Edit Form" => See the "active template" for [Property list ListName] or [Form] => But this "active template" has been renamed in the "templates.dist" folder or "onoffice-personalized" folder.
    => Screen shows notification: "Edit List view" or "Edit Form" by a specific ID.

Please confirm my above statements exactly.
Note: Especially the "screen show notification" and "behavior". Thanks!

@fredericalpers
Copy link
Member Author

@dai-eastgate as far as I can see the statements are correct. Please go ahead and try to implement this. Thank you :)

@dai-eastgate dai-eastgate self-assigned this Jan 8, 2024
@dai-eastgate
Copy link
Contributor

@fredericalpers

  • I have implemented the following cases:
  1. Incorrectly selected template
  2. Delete activated template
    Here is my video test.
cmt_698.mp4
  • There is a conflict in the logic of the following cases => covering all logic to display multiple notifications is no control.
  1. Delete any template
  2. Rename any template
  3. Rename activated template

=> I need three more days to investigate the display of multiple notifications simultaneously, and I will respond to you about its feasibility.

@fredericalpers
Copy link
Member Author

The tests in the video look promising already. Thank you :)

@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jan 18, 2024

@fredericalpers
During the implementation process, I have these points of view:
A. We can not control:

  • When does the behavior user "delete file templates" in the folder ?=> can not check the numbers of file templates "before delete" and "after delete" to handle "logic delete a template".
  • Behavior user "rename file templates" in the folder does not follow any rules => there is no way to handle "logic rename a template".

B. I can only check which files are having changes (this change can be a "deleted File" or "rename File").

=> The solution I suggest is:

  1. "Change content" for notification "Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?"
    => "Deleting or renaming a template can lead to visual and critical errors on your website. The template "TemplateName" has been deleted or renamed."

  2. "Change content" for notification "The active template for [Property list ListName] has been deleted. Please select a new template."
    => "The active template for [Property list ListName] has been deleted or renamed. Please select a new template."

Do you agree with my opinion or do you have another suggestion?

I have implemented this suggestion in branch 43297-error-handling-deleted-or-incorrectly-selected-templates for you to consider.
Here is the video I tested: https://files.fm/u/k8n3j4nyn7

@fredericalpers
Copy link
Member Author

@dai-eastgate this sounds good to me, thank you for your efforts :) can I label this as in review?

@dai-eastgate
Copy link
Contributor

@dai-eastgate this sounds good to me, thank you for your efforts :) can I label this as in review?

@fredericalpers Can you wait a few minutes while we'll create a PR for this branch. Thanks!

@fredericalpers fredericalpers added the QA Issue or Pull request that is in review label Jan 19, 2024
@fredericalpers fredericalpers added MW and removed MW labels Feb 6, 2024
@fredericalpers fredericalpers added feature New feature UI/UX Issue, Pull Request or Discussion related to UI/UX component: property list Issue, Pull Request or Discussion related to property lists component: property detail page Issue, Pull Request or Discussion related to property detail page component: dashboard Issue, Pull Request or Discussion related to dashboard / settings page component: contact form Issue, Pull Request or Discussion related to contact forms component: interest form Issue, Pull Request or Discussion related to interest forms component: owner form Issue, Pull Request or Discussion related to owner forms component: unit list Issue, Pull Request or Discussion related to unit lists and removed component: dashboard Issue, Pull Request or Discussion related to dashboard / settings page labels Feb 20, 2024
@fredericalpers fredericalpers removed this from the v4.20 milestone Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: contact form Issue, Pull Request or Discussion related to contact forms component: interest form Issue, Pull Request or Discussion related to interest forms component: owner form Issue, Pull Request or Discussion related to owner forms component: property detail page Issue, Pull Request or Discussion related to property detail page component: property list Issue, Pull Request or Discussion related to property lists component: unit list Issue, Pull Request or Discussion related to unit lists feature New feature QA Issue or Pull request that is in review UI/UX Issue, Pull Request or Discussion related to UI/UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants