salesagility / SuiteCRM

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

Fix #10264 Error Assigned_user_name SearchView.tpl (`{php}` tag now crashes Smarty 4) #10309

Open chris001 opened 8 months ago

chris001 commented 8 months ago

Fixes #10264

The {php} tag was removed from Smarty 3.1. There was an omission in converting the Smarty code in this code to be compatible with current Smarty version used, in the current maintenance release 7.14.2.

Somehow, this {php} tag was left in this template file. Smarty 3.1 has removed {php} tags. It must be replaced with Smarty 3.1+ compatible code.

Description

Replace old {php} tag code with new code that works with Smarty 3.1+.

Motivation and Context

The software will crash on this screen because {php} tag is no longer supported by current Smarty version used.

How To Test This

Run Suite 7.14.2 and go to this screen. It should fail. Apply this fix and go to this screen. It should work.

Types of changes

Final checklist

SuiteBot commented 8 months ago

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

https://community.suitecrm.com/t/upgrade-from-7-13-to-7-14-cause-editview-errors-regarding-php-tags/91515/5

serhiisamko091184 commented 8 months ago

Hello @chris001,

thank you for this PR,

I'm afraid I'm not able to apply current fix:

Having suggested changes in the codebase I remove the application and the browser cache: image

image

image

I can't get the popup view rendered: image

Additional check: commenting out given line gives me an opportunity to get the view (without options in select as I don't pass them on the tpl):

image

image

Thanks in advance for your response!

chris001 commented 8 months ago

Sorry for that @serhiisamko091184 I reworked the fix, tested it locally on Bitnami Suite 7.14.1 on PHP 8.1, and it works now. fix 10264 smarry php tag crashes smarty4 Please re-check on your side.

serhiisamko091184 commented 8 months ago

Hello @chris001,

thanks for your quick reply and update,

this fix works fine.

Thanks a lot!

Regards, Serhii

SuiteBot commented 3 weeks ago

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

https://community.suitecrm.com/t/syntax-error-in-template-on-line-248-php-unknown-tag-php/94115/7