1127

The new updated Trongate

Comments for “The new updated Trongate”
 

Posted by lunaticthrasher on Sunday 22nd October 2023 at 19:52 GMT

This is about Trongate Pages again but also had to edit engine\tg_helpers\url_helper.php,

Parse error: syntax error, unexpected '|', expecting '{' in C:\xampp\htdocs\pages_test2\engine\tg_helpers\url_helper.php on line 135

When I take the : string|float out it loads the webpage. Then these come up with trongate pages,

Parse error: syntax error, unexpected '|', expecting ';' or '{' in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 233

So I take out - : string|false then i get this,

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 313

So I Take out - bool|null then I get this,

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 351

So I Take out another - bool|null then I get this,

Parse error: syntax error, unexpected '|', expecting ';' or '{' in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 1298

So I take out : string|bool there then I get this,

Parse error: syntax error, unexpected '|', expecting ';' or '{' in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 1456

So I take out : int|string and then get this,

Parse error: syntax error, unexpected '|', expecting ';' or '{' in C:\xampp\htdocs\pages_test2\modules\trongate_pages\controllers\Trongate_pages.php on line 1511

I take out : string|false and the pages admin loads up. When I try to make a page it does make the page but I can not edit the page or change anything. I know this is a php 8 thing and I'm running php 7.4 because that is what my Host uses. Now here is the kicker, on my localhost I can make pages and edit with xampp, but when i tested it on my host server thats when I got the problems with not being able to edit. So could it be the .htaccess or the php.ini on my host server making the problems?
Early Adopter

lunaticthrasher

User Level: Early Adopter

Date Joined: 29/10/2019

Posted by DaFa on Sunday 22nd October 2023 at 23:29 GMT

Hi Tom,

You are correct that union types now being added have made Trongate a version PHP 8+ framework. So removing them for servers running PHP 7 is a must.

Host servers are usually set up to be more strict than an install of Xampp. I would add some 'check1' and 'check2'... inserts in the tgPages code to see where it's falling over on the server and deal with it then, as it would be nearly impossible for me to guess with the bit of info you have supplied.
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by lunaticthrasher on Monday 23rd October 2023 at 22:50 GMT

Thanks for the reply Dafa, I was thinking this might be the answer. I'll do what you suggested and see what I come up with. If anything I can do edits on my localhost and just update the server side that way for now until my host plan updates to php 8.
Early Adopter

lunaticthrasher

User Level: Early Adopter

Date Joined: 29/10/2019

Posted by DaFa on Tuesday 24th October 2023 at 03:54 GMT

Hi Tom,

When using the hosted version of your site have you opened the console window to see if any error messages pop up when you try to edit a page? If so, paste them back in here to see if we can't get to the bottom of things.
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Davcon on Wednesday 25th October 2023 at 00:15 GMT

Apologies for your having to go through that. We've always emphasized that stability is the top priority for Trongate, and that remains the case.

Unfortunately, our unwavering commitment to stability has led to numerous naysayers claiming that 'Trongate is old-fashioned.' They are clearly misguided! Nevertheless, this situation places us in a difficult predicament:

Do we stick with PHP, which the rest of the world considers outdated?

OR

Do we embrace and utilize new PHP features as they are released, even if it comes at the cost of stability?

There's no simple answer. If we prioritize stability, we face accusations from Laravel developers who label us as old-fashioned. On the other hand, if we adopt new PHP features, we risk compromising stability, our primary concern.

At present, it seems our policy has settled into something like this:

When new PHP features are introduced, we will evaluate them on their merit. If a particular feature doesn't bring substantial value, we won't implement it.

However, if a new feature does offer genuine benefits, we'll make every effort to gradually introduce it in a way that minimizes inconvenience to end-users. This typically involves waiting for two years before a full-scale implementation.

In the case of type hinting and return types, I believe they provide real value for two reasons:

1). They offer developers a clear, structured, and formal mechanism for documenting and describing how functions operate.

2). They enhance security because incorrect variable types passed into a PHP function result in graceful errors.

In November, our two-year rollout period for type hinting and return types will come to a conclusion. Once again, none of this is ideal, but at least we've exercised patience, rather than just pulling the trigger - as happened with Symfony, for example.

If you or anyone else has a solution for the challenge we face regarding the incorporation of new PHP features, please do share your insights.
Founding Member

Davcon

User Level: Founding Member

Date Joined: 3/11/2018

Posted by perkin524 on Friday 26th January 2024 at 14:17 GMT

I have just updated Trongate and, as discussed above, had to switch to php version 8.3 in my local server. So that works and is potentially very exciting but I see now that no trongate_pages module has magically appeared. Should it have or do I have to create one from scratch and if so, should there be an extra tutorial covering it?

I have another question which is: trongate_pages may let me create a blog or articles or news items but can I use trongate_pages to create, say, a blog and articles and news all on separate modules? And can I allow subscribed users to add content?

perkin524

User Level: Guest

Date Joined: 7/07/2021

Posted by DaFa on Saturday 27th January 2024 at 05:26 GMT

Hi Perkin,

Welcome back to the fold!

If I am reading your post correctly; you have upgraded your dev environment to use PHP 8.3 and I assume you have installed the current version of Trongate either with the Desktop app or directly via GitHub.

The welcome landing page in Trongate has an all-new look since you may have seen it last. Trongate Pages is still there, you just have to navigate to it. Either by logging into the admin panel via the blue 'Admin Panel' button (using credentials shown admin/ admin) or just enter the following URL
http://localhost/{your_app_name}/trongate_pages/manage
Here are a few links to an intro
https://www.youtube.com/watch?v=buHoHqNELu0
and a quick tutorial
https://www.youtube.com/watch?v=CzKXVRFIA80
However, the docs are yet to be written - so stay tuned for that when DC gets round updating the Trongate Docs.

Your last question about whether tg_pages allows you to create separate modules and subscribed users access them. Is all possible but it is up to you as the developer to create and manage your users and then allow them to interact with each page (user levels, custom routes, etc...) from your custom modules. It is not the function of tg_pages to create these for you. Hint: look at the table structure of `trongate_pages` in your database and its content, then how it saves assets you add - remember it is a CMS, not a code generator that does everything for you.

I'm not sure if you are a member of David's YouTube channel but there are countless hours of him developing an online engine shop for a REAL client. Where he uses tg_pages extensively to build an admin panel for his client to add/ remove content via a category module that then gets displayed on the landing page. He also adds custom widgets to tg_pages along the way. All is well worth the cost of a Happy Meal each month! Join now if you haven't already!

Cheers, and happy coding!
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by perkin524 on Saturday 27th January 2024 at 22:04 GMT

Hi DaFa,
Thanks very much for responding so fully. I've been out of touch because I have not been well but OK now so - on I go.

I am indeed using PHP8.3 and I have installed the current version of Trongate. I first opened a new app and got all the goodness of tg_pages which was fantastic. I think I have checked out all links. But then tried to update my app called 'howarthpark' built with Trongate. Howarthpark is still working as expected except that, whereas in the test app, I could see the new module 'trongate_pages', it is not there in howarthpark. I use Vscode (great tg snippets btw!) and if I use the search I can see references to tg_pages in the engine including in 'element_adder.php' which possibly ought to be adding the module?

You suggested I try the url:
http://localhost/howarthpark/trongate_pages/manage

but I got a 404 error which I expected, given no module.

Any ideas? Do I need to reinstall?

Mike

(Re my second query, got that thanks.)

perkin524

User Level: Guest

Date Joined: 7/07/2021

Posted by DaFa on Saturday 27th January 2024 at 22:42 GMT

Hi Mike,

The Desktop app will only update the 'engine' folder of an existing app, so you will need to 'cherry pick' all the other new or modified folders and files to bring them over. If an existing app is so old, I will do the reverse, create a new app, and then pull over the parts I want from an older app.

This comment was edited by DaFa on Sunday 28th January 2024 at 05:12 GMT

Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by perkin524 on Sunday 28th January 2024 at 10:04 GMT

Thanks DaFa, that's very clear and understood. I think it might help to be a bit more explicit in the docs.
I swapped the module with the 'wizard' and that worked fine. Maybe it would be useful to include it on the Module Market for anyone upgrading?

This comment was edited by perkin524 on Sunday 28th January 2024 at 15:50 GMT

perkin524

User Level: Guest

Date Joined: 7/07/2021

×