Problem with tpls files in suitecrm version 7.14

Hi, I have this problem:
I have recently switched to version 7.14.2 of suitecrm and consequently to version 8.1 of PHP, I am testing the custom modules, created in the old version of suitecrm (7.12) and everything seems to work (I had to make some changes), but now I have installed a module already known on this forum and it is Advanced Report (which I have used a lot in previous versions and which I find very useful) which gives me an error when executed (Run Report):

Exception in Controller: Syntax error in template "/suitecrm/modules/adrep_report/tpls/RunReport.html" on line 79 "{html_options name=hour_$name options=$hours selected=$parameter.hour}:" - Unexpected "$name", expected one of: "}"

I imagine something has changed in the handling of tpls files, but I don’t know how to modify this code to be accepted.

Do you have an answer to this problem?

Can you get in touch with that add-on’s developer?

These fixes for new PHP versions are usually not too difficult to make

No, I don’t remember the name of the person who developed it, I also believe that the changes should not be huge, but I don’t know how to change them, I’m trying, but nothing changes

You can find the add-on developer here

I contacted mvnrsa, but unfortunately he couldn’t help me.
Is there anyone else who uses the Advanced Report module created by mvnrsa and has upgraded to SuiteCRM version 7.14? Have you had the same problems as me? How did you solve them? Please, it’s important.

Hello @fab

I understand you’re encountering an error with the Advanced Report module in SuiteCRM 7.14.2 after upgrading to PHP 8.1. The error seems to be related to a syntax change in the html_options tag within the RunReport.html template file.

Here are some steps you can take to resolve this issue:

1. Contact the Add-on Developer:

  • The most recommended approach is to reach out to mvnrsa, the developer of the Advanced Report module. They likely have encountered this issue before and might already have a fix available.
  • You can find them here

2. Modify the RunReport.html File (if comfortable):

  • If contacting the developer isn’t an option, you can try modifying the RunReport.html file yourself. However, this requires familiarity with Smarty syntax and the html_options tag. The goal is to remove the reference to $name within the attribute or restructure the code to avoid using it.

3. Seek Help from the SuiteCRM Community:

  • If modifying the code yourself seems daunting, don’t hesitate to seek help from the SuiteCRM community forums. Share your specific issue and the relevant code snippet, and someone with more experience might be able to guide you through the fix.

Remember, modifying core files might not be the best approach unless you’re comfortable with SuiteCRM development. Prioritize contacting the add-on developer or seeking help from the community for specific guidance.

I hope this helps!

Thanks.

I have already done the steps you described, I ran out of ideas, which is why I was hoping there was someone else who used this module.
I contacted the developer, but he can’t help me.
I’m modifying the code hoping to solve it, but not being a smarty expert, I’m going a bit blind.

What I can say is that, in html_options, the lines containing name=..._$name, therefore:

{html_options name=hour_$name options=$hours selected=$parameter.hour}

and not only this line, also others with the same syntax, not only in this file, but also in others:

{html_options name=min_$name options=$minutes selected=$parameter.min}

by changing min_$name (for example) to min_name, the error goes away and the page appears, but it doesn’t work well

@chirag_biz309 please don’t post ChatGPT answers here in these forums. They are rarely useful, sometimes misleading, and if people want ChatGPT they can go and use it themselves.

@fab I am not sure your problem is a Smarty problem in the HTML file. It might also be a PHP problem in the file that prepares (assigns) the smarty variables and then tries to render the template.

Any way, I don’t think you can just remove the $name variable from there, that is never going to work.

Yes @pgr, I had thought about it and in fact I tried to reconstruct the path to see where the problem was, but the error is generated when the file where that line is is recalled.
I know it will never work by removing that variable, I was just experimenting to understand how to solve it.