1084

Possible syntax error in Model.php?

Comments for “Possible syntax error in Model.php?”
 

Posted by armine.sharafyan on Saturday 13th April 2024 at 19:12 GMT

Hello to all,
I tried to play with Trongate after a very long interval,
I am not a professional developer, I just put together small applications for the internal use of our businesses.
So, I downloaded the latest version of the Trongate Desktop App and generated a new app.
This is the message I get trying to sign in as admin:
Parse error: syntax error, unexpected token "|", expecting ";" or "{" in C:\xampp2024\htdocs\lavash\engine\Model.php on line 629
Founding Member

armine.sharafyan

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Balazs on Saturday 13th April 2024 at 21:16 GMT

Hello Armine,
I have already sent a pull request with the fixes. It has to do with the function return types in Model.php. Once my changes are merged into the main Trongate repo, you should be good to go!
Level One Member

Balazs

User Level: Level One Member

Date Joined: 8/04/2023

Posted by armine.sharafyan on Saturday 13th April 2024 at 22:21 GMT

Hello, Balazs,

Thank you for your response. At first glance at the code on the mentioned line 629, I had the impression that there was a syntax error with the expression with the ternary operator...
But I am not a developer and the last time I looked into code was about 2 years ago...
Model.php is a core part of the framework and I hope professional developers will fix it.
Founding Member

armine.sharafyan

User Level: Founding Member

Date Joined: 30/11/2018

Posted by DaFa on Sunday 14th April 2024 at 00:08 GMT

Thanks Balazs, I have pulled in your fix and will check over other changes made to ensure we are all good.
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Balazs on Sunday 14th April 2024 at 02:21 GMT

Don't worry Armine, we got your back. DaFa was so kind and merged my pull request with the fixes quickly. Thank you DaFa!
I created a new app with the updated code and it's working now without any syntax errors.

If you encounter any further problems, please let us know. I will keep an eye out too!
Level One Member

Balazs

User Level: Level One Member

Date Joined: 8/04/2023

Posted by armine.sharafyan on Saturday 20th April 2024 at 03:28 GMT

Hello to all,
Thank you, Simon!
I was checking twice a day to see if the problem was resolved.
As it is still mentioned as open I thought I needed patience.
I thought maybe I could try to replace the Model.php with an old version of it (I have some old apps I still use).
But I decided to try once more creating a new app first. And it works fine!!!
I think you should close this issue.
Thank you once more!
Thank you, Balazs, too, for your efforts and readiness to help.
Founding Member

armine.sharafyan

User Level: Founding Member

Date Joined: 30/11/2018

Posted by DaFa on Saturday 20th April 2024 at 07:03 GMT

Hi guys,
I did pull this in and all was good. However, DC decided to roll back his changes to the helpers and model. So all type hinting and return types have been removed from these files

It is also worth noting, Trongate requires PHP 8 or higher to run.
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

×