YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.68k stars 727 forks source link

[bug] Mentions broken #11510

Closed vovpff closed 4 years ago

vovpff commented 4 years ago

🐞 bug report

⁉️ Describe the bug

Too few arguments to function App\Utils\Completions::decodeRecordText(), 1 passed in /home/gitdevelop/domains/gitdeveloper.yetiforce.com/public_html/app/Utils/Completions.php on line 105 and exactly 2 expected.

When edit record what contain mention inside WYSYWIG

πŸ”₯ How to trigger the error

broken mentions

πŸ‘· Testing

πŸ“· Screenshot of configuration

πŸ“ PHP/Apache/Nginx/Browser/CRM Logs

#0 app/Utils/Completions.php(105): App\Utils\Completions::decodeRecordText(1017)
#1 [internal function]: App\Utils\Completions::App\Utils\{closure}(Array)
#2 app/Utils/Completions.php(111): preg_replace_callback('/(\\@|\\#){2}(\\d+...', Object(Closure), 'Sie\xC5\x84 wielka ja...')
#3 modules/Vtiger/uitypes/Text.php(59): App\Utils\Completions::encode('Sie\xC5\x84 wielka ja...')
#4 modules/Vtiger/models/Field.php(1141): Vtiger_Text_UIType->getEditViewDisplayValue('Sie\xC5\x84 wielka ja...', Object(FInvoice_Record_Model))
#5 cache/templates_c/basic/3a7c9aafd3ae9e8d4db4458a0e573332eacadc92_0.file.Text.tpl.php(27): Vtiger_Field_Model->getEditViewDisplayValue('Sie\xC5\x84 wielka ja...', Object(FInvoice_Record_Model))
#6 vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5d7f18d37c8a09_19291732(Object(Smarty_Internal_Template))
#7 vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#8 vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#9 vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#10 cache/templates_c/basic/84d302f6d4d7f0fc9b8826453fe71dae28657e7a_0.file.EditViewBlocks.tpl.php(117): Smarty_Internal_Template->_subTemplateRender('modules/Vtiger/...', NULL, NULL, 0, 3600, Array, 0, true)
#11 vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5d7f18d36e2ac7_46942060(Object(Smarty_Internal_Template))
#12 vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#13 vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#14 vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#15 cache/templates_c/basic/6e283430ebda4cbd082133c7ca3690d007fa7b5a_0.file.EditView.tpl.php(24): Smarty_Internal_Template->_subTemplateRender('modules/Vtiger/...', NULL, NULL, 0, 3600, Array, 0, true)
#16 vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5d7f18d36bf546_71529716(Object(Smarty_Internal_Template))
#17 vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#18 vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#19 vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)

🌍 Your Environment

Environment Version / Name
YetiForce gitdev, my crm also
Web server (name and version)
PHP
Browser (name and version)
Operating System (name and version)
Database (name and version)

❓ Additional context

Add any other context about the problem here.

❗️ Inform the community if you solve the problem

vovpff commented 4 years ago

@mariuszkrzaczkowski pls take a look here. I think this is critical because this is impossible to edit records what already has mentions inside.

vovpff commented 4 years ago

My temporary solution: https://github.com/YetiForceCompany/YetiForceCRM/blob/60180401e0ede704b5dcfac31ce359d2c122482f/app/Utils/Completions.php#L235 (int $recordId, string $recordLabel) should be replaced with (int $recordId) This is founded in diff for this commit https://github.com/YetiForceCompany/YetiForceCRM/commit/6bd68be951092a188e6d980fd672c74d560f223a#diff-b949e70902029699144f905c1a16eb9dR235