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

Fix #10511 - make correct redirect to Opportunity's DetailView without extra data from submitted form #10512

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

mubat
Copy link

@mubat mubat commented Sep 2, 2024

Fixed issue #10511.

Description

Issue happens because user not redirected to other page but submitting form on "Contact-Opportunity" page with other form data that should send at request. And this data wrongly adds to search queries because SubPanel class uses SeacrhForm functionality to filter data and SearchForm grubs data from $_POST that should happens for subpanels. Thats why it includes contact_name and contact_id to SQL that doesn't include this tables and shouldn't filter by these params.
Example of wrongly generated SQL:

SELECT count(*) c FROM meetings  LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c  INNER JOIN  opportunities meetings_rel ON meetings.parent_id=meetings_rel.id AND meetings_rel.deleted=0
 AND meetings.parent_type = 'Opportunities'
 where ( meetings.parent_id='37f91d5123-4123b-1e77-c115-66ba1b2a814c' AND (meetings.status !='Held' AND meetings.status !='Not Held') AND (( contacts.first_name like 'John23 test%' OR contacts.last_name like 'John23 test%' ))) AND meetings.deleted=0 )  

Steps to reproduce issue

  1. Open DetailView of some Opportunity that has linked Contact at subpanel
  2. Expand 'Contacts', 'History' and 'Activities' subpanels
  3. Click 'Edit' on Contact at subpanel
  4. It opens custom page to manage role of the Contact at Opportunity
  5. Click "Cancel"
  6. It returns to Opportunity's DetailView

[ER]: all subpanels works fine without errors and print linked data
[AR]: have message at some subpanels "Database failure. Please refer to suitecrm.log for details."
image

Motivation and Context

This bug breaks business logic at out company. Extra data from "Contact-Opportunity" form should send to Opportunity's DetailView page.
This PR fixed issue with broken subpanels on Opportunity DetailView, one of the most common modules.

How To Test This

Open "Contact-Opportunity" page from Contacts subpanel and click "Cancel".

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@SuiteBot
Copy link

SuiteBot commented Sep 2, 2024

CLA assistant check
All committers have signed the CLA.

…lView without extra data from submitted form
@serhiisamko091184
Copy link
Contributor

Hello @mubat!

Thanks for your contribution!

Regards,
Serhii

@serhiisamko091184 serhiisamko091184 added Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Branch:Hotfix PR 4-8 Score given to PRs once assessed Status: Requires Code Review Needs the core team to code review labels Sep 11, 2024
@jack7anderson7 jack7anderson7 added Status: Passed Code Review Mark issue has passed code review reviewed Status: Requires Testing Requires Manual Testing and removed Status: Requires Code Review Needs the core team to code review labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Branch:Hotfix PR 4-8 Score given to PRs once assessed Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Passed Code Review Mark issue has passed code review reviewed Status: Requires Testing Requires Manual Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants