Page 1 of 2

Need help testing: PHP 8.1 compatibility for FlatPress 1.3

Posted: Sat Jun 25, 2022 11:19 am
by Arvid
Hi community,

in order to make FlatPress PHP 8.1 compatible, I spent quite a lot of time on making everything work with the current 4.x version of the Smarty template engine (see issue 94).
You'll find the current code in the Smarty update branch: https://github.com/flatpressblog/flatpr ... artyupdate

Notes:
  • All improvements and bugfixes from the main development branch (such as the Gallery captions plugin and the PhotoSwipe plugin) are already contained in the Smarty update branch.
  • With Smarty 4, FlatPress' minimum requirement is PHP 7.1 (was 5.6 until then).
  • Smarty 4 is much less forgiving when it comes to syntax correctness of your template files. Also, the Smarty function name schema changed from underline_style to CamelCaseStyle, e.g. getTemplateVars() instead of get_template_vars().
    Make sure your plugins and themes continue to work.
To be sure I didn't miss something, I ask you for your support: Can you please test FlatPress from the Smarty update branch thoroughly, and let me know if everything works fine?

If so, I'd then merge this branch back into the master (and into the Responsive admin branch, which then would have to be tested as well).
Then I can continue to work on PHP 8.1 compatibility with issue 92: The unholy "strftime() is deprecated" problem... :?

Thanks a lot,
Arvid

Re: Need help testing: Smarty update

Posted: Tue Jun 28, 2022 6:23 pm
by stippi
Hi Arvid,

as I'm very much interested in PHP 8.1 compatibility and curious about the progress I tried to get the things running, but failed in a way. Whenever I try login in to the admin area, I cannot get in. It jumps back to an empty login mask after inserting the credentials and hitting ENTER. Using a wrong password gives a "wrong password" message, as expected. I downloaded your recommended Smarty update branch and put it under /var/www/html/fp. Basic installation was no problem. All steps to setup FP have been sucessful.

I first tried it with Debian 5.10.120-1 (2022-06-09) x86_64 , PHP Version 8.1.7 and Apache/2.4.53 (Debian) and then with another server running Debian 5.10.106-1 (2022-03-17) x86_64, PHP Version 7.4.28 and Apache/2.4.53 (Debian). Restart of Apache service didn't help so far. What did I miss? :?:

Regards
stippi

Re: Need help testing: Smarty update

Posted: Tue Jun 28, 2022 7:31 pm
by Arvid
Hi, thank you very much for testeing and reporting.
Oddly, I can't reproduce this behaviour. I took the Smarty Update branch freshly from GitHub and put it in my PHP 8.1.2 XAMPP environment (Windows). Installer worked like a charm (well, with a deprecated warning I need to take care of), and finally I am proceeding to the home page. Clicking "Login" leads to the login page where I enter my credentials - hitting Enter logs in as expected.
(Of course, I encounter all the ugly Function strftime() is deprecated messages I am going to tackle with the strftime branch.)

Is anyone else stumbling upon the login issue stippi described?


All the best,
Arvid

Re: Need help testing: Smarty update

Posted: Wed Jun 29, 2022 2:16 pm
by George
Hi guys
i downloaded and installed a a couple of hours ago.
It fell apart when i tried to us FlatMistyLook theme and i had to reinstall
So i quickly modified leggero to suit my needs, have create a static page and also made a blog post, no problems logging in or out using chrome opera or firefox
so far so good
it looks promising
demo https://www.mypoppy.uk/blog2/
George

Re: Need help testing: Smarty update

Posted: Wed Jun 29, 2022 3:28 pm
by laborix
stippi wrote: Tue Jun 28, 2022 6:23 pm... as I'm very much interested in PHP 8.1 compatibility ...
a quick test of the Flatpress Smarty 4 version under PHP 8.1 produces the following with maximum error checking:

Code: Select all

Last Setup Step - Login or page looks
Deprecated: Automatic conversion of false to array is deprecated in .../fp-smarty4/fp-plugins/prettyurls/plugin.prettyurls.php on line 410

Blog Welcome Page

Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 30
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 48
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 16

Login Page

Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 30
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 48

Administration Area

Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 30
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 48

Manage Entries

Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 48

Write entry

Subject:
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../fp-smarty4/fp-includes/core/core.wp-formatting.php on line 204

Text area:
Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in .../fp-smarty4/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^1f7adbccfb8e329335e1539d0ce4e63da2e8be81_0.admin.entrywrite.php on line 103

Write static

Subject:
Deprecated</b>:  preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../fp-smarty4/fp-includes/core/core.wp-formatting.php on line 204

Text Area:
Deprecated</b>:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in .../fp-smarty4/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^9b6fecd64e7575fe857424b820cf2e81bd835901_0.admin.staticwrite.php on line 102

Gallery captions

Fatal error: <-- thrown in .../fp-smarty4/fp-includes/smarty-4.1.0/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 4

Options - on all three settings

International settings - Default format for date
International settings - Default format for date (short)
International settings - Default format for time 

Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 30
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 48
Deprecated: Function strftime() is deprecated in .../fp-smarty4/fp-includes/core/core.date.php on line 16
There is still some work to be done, especially in the current Smarty template engine?

regards

Re: Need help testing: Smarty update

Posted: Wed Jun 29, 2022 3:45 pm
by laborix
stippi wrote: Tue Jun 28, 2022 6:23 pm... I first tried it with Debian ... What did I miss? ...
On Linux systems, it is very important to ensure that the fp-content has the correct access rights. Windows is sometimes a bit more accommodating. I'm not sure, but you could check the fp-content/config folder to see if the correct configuration is stored there.

Alternatively, I would try a password like "123456", not that an incorrect character/language set might play a role here.

regards

Re: Need help testing: Smarty update

Posted: Wed Jun 29, 2022 5:08 pm
by George
Just to say ive test on window 10 with xampp and PHP Version 8.0.19Image Also Linux (AlmaLinux 8.6) php 7.2.24

Re: Need help testing: Smarty update

Posted: Sat Jul 09, 2022 12:43 pm
by Arvid
laborix wrote: Wed Jun 29, 2022 3:28 pm There is still some work to be done, especially in the current Smarty template engine?
Hi,

no, Smarty is fine as of v4, this is all FlatPress code that still needs to be fixed (issue 92). This is my next big task on our way to PHP 8.1 compatibility - I'll let you know when I'm done! :)

All the best,
Arvid

Re: Need help testing: Smarty update

Posted: Sun Jul 10, 2022 5:14 pm
by virtualsky
Arvid wrote: Tue Jun 28, 2022 7:31 pm
Is anyone else stumbling upon the login issue stippi described?
Yup... Just testing Smarty for myself. I'm getting the same response. I log in and just get sent back to the log in screen. If I put in a wrong password, I get the incorrect login warning. Setup seemed to have completed fine.

I've also tried clearing browser cookies and history. No help.

UPDATE:

I figured it out... at least for me. You must use https:// not just http:// to log in. Once I made sure I was using the secured connection, I could log in just fine.

I have noticed that when ever I make a change to one of the Admin config screens, like changing date and time formats, or activating or deactivating a plugin, I have to reload the web-page after the "Changes Are Saved" notification. If I don't and go and make another change without reloading, I get save errors. Not a big deal, just something to remember to do.

Re: Need help testing: Smarty update

Posted: Mon Jul 11, 2022 7:34 am
by stippi
virtualsky wrote: Sun Jul 10, 2022 5:14 pm
UPDATE:

I figured it out... at least for me. You must use https:// not just http:// to log in. Once I made sure I was using the secured connection, I could log in just fine.
Hi everyone,

virtualsky is absolute right. I activated secure HTTP and went on with success. Thank you!

stippi