salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.26k stars 2.03k forks source link

After migration from 7.14 to 8.6 - Contracts subpanel in Accounts does not work #10440

Open torinfo opened 1 month ago

torinfo commented 1 month ago

Issue

After migration from SuiteCRM 7.14 to 8.6 the Contracts subpanel in Accounts gives an error in the browser console:

ERROR node_modules_angular…1a513b7cb4915e.js:1 TypeError: r.match is not a function

See attached file for the complete stacktrace. None of the other panels work until this panel is switched off again.

Possible Fix

No response

Steps to Reproduce the Issue

1. Go to an account (with a contract)
2. Switch on the Contracts sub-panel
3. The panel appers and only show the title (in my case) of the first contract. It show in th epagination how many contrats there should have been
There is an error in the console.

Context

I am trying to fid a contract through Accounts. The other way arround (Go to contracts and filter on account) seems to work fine.

The error stack that is reported in the browser console is attached. crm.dlearning.nl-1717148537573.log.zip

Version

8.6.0

What browser are you currently using?

Chrome

Browser Version

Version 125.0.6422.77 (Official Build) (64-bit)

Environment Information

MariaDB 10.6.16, PHP 8.1.2

Operating System and Version

Ubuntu 22.04.4 LTS

torinfo commented 1 month ago

Found the problem.

Somehow in the metadat of the subpanel the type of the ACCOUNT_CONTRACT was 'date' instead of 'relate':

'contract_account' => array ( 'type' => 'date', 'vname' => 'LBL_CONTRACT_ACCOUNT', 'width' => '20%', 'default' => true, ),

After changing it to 'relate' (and running reapair) the error disappears.

pgorod commented 1 month ago

Doesn't that need to be fixed here?:

https://github.com/salesagility/SuiteCRM/blob/hotfix/modules/AOS_Contracts/metadata/subpanels/default.php#L28

SuiteBot commented 1 month ago

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/after-migration-from-7-14-to-8-6-contracts-subpanel-in-accounts-does-not-work/92977/5

torinfo commented 1 month ago

@pgorod Yes, you are absolutely correct, but as I have a custom definition, I did not notice this.

pgorod commented 1 month ago

Yeah, I am glad that I went and checked. I figured that this was a very illogical thing to put in the file, so you wouldn't have any reason to do it, it probably came from the original file. And there is was, an 11+ year-old bug...