Problem upgrade from 1.0.3 to 1.1

This is the right place to report general bugs, make suggestions or ask for help.
Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Problem upgrade from 1.0.3 to 1.1

Post by Panther » Fri Mar 27, 2020 2:05 am

Hi, I tried to upgrade existing flatpress version from 1.0.3 to 1.1 how described

>Simply unzip the update package and transfer its contents to your server. Overwrite existing files.

I created a new directory (https://www.guerrenelmondo.it/mio/), copied entire website and transferred and overwritten files of 1.1 version:

At the end of transferred files there is this error:

Parse error: syntax error, unexpected '[' in /web/htdocs/www.guerrenelmondo.it/home/mio/fp-inclu ... .draft.php on line 187

The old website works perfectly (https://www.guerrenelmondo.it/), while the new version on new directory not.
version PHP is Version 5.3.29

What I can do ?
Thanks

laborix
Posts: 18
Joined: Sat Feb 16, 2019 3:51 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by laborix » Tue Mar 31, 2020 5:28 pm

Hi,

your new Flatpress 1.1 is running on PHP 5.3?

The error is a typical PHP 7.4 error, because some Syntax like function xyz ( …element… ) [0] … are no more allowed. So, please, what is PHP Version on which your Flatpress 1.1 is running?

regards

Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by Panther » Tue Mar 31, 2020 11:42 pm

On Flatpress 1.1 there is version 5.3.29 (is only a subdirectory https://www.guerrenelmondo.it/mio/) like on main website https://www.guerrenelmondo.it

Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by Panther » Tue Mar 31, 2020 11:54 pm

Moreover https://www.guerrenelmondo.it works only with php version 5.3.29 and if I choice this php.ini

zip_cgi.fix_pathinfo Impostazioni avanzate per utenti esperti con: cgi.fix_pathinfo = 1 e Estensione Zip Abilitata

Others version of php and php.ini doesn't work.

laborix
Posts: 18
Joined: Sat Feb 16, 2019 3:51 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by laborix » Wed Apr 01, 2020 4:39 pm

I didn't test this solution, but please download the buggy core.draft.php, editing the file and upload it back.

Quick and dirty solution: Replace the lines 185 to 189

Code: Select all

if ($arr) {
  $firstElement = utils_array_kshift($arr);
  $id = array_keys($firstElement) [0];
  $subject = $firstElement [$id];
}
with the old lines of core.draft.php from Flatpress 1.0.3

Code: Select all

if ($arr)
  list($id, $subject)=each($arr);
If this will not work on your Web Space, you can try this one:

Code: Select all

if ($arr) {
  $id = key($arr);
  $subject = current($arr);
  next($arr);
}
I didn't have a test environment with PHP 5.3.x, but I know that Flatpress 1.1 is running on PHP 7.3.x.

Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by Panther » Wed Apr 01, 2020 8:47 pm

Hi, I have good news, it works perfectly with both solutions:

if ($arr)
list($id, $subject)=each($arr);

and with

if ($arr) {
$id = key($arr);
$subject = current($arr);
next($arr);
}

Which one is better and I more useful ?

Thanks

Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by Panther » Wed Apr 01, 2020 9:05 pm

There is another thing, in old version (1.03) I can see this article:

https://www.guerrenelmondo.it/index.php ... ghanistan/


With new version 1.1 I can't see this article:
https://www.guerrenelmondo.it/mio/index ... ghanistan/

the error is:

Non trovato

Siamo spiacenti, non possiamo trovare la pagina richiesta


The name of article is:
Mozambico: Gruppo terroristico ISIS rivendica responsabilità per gli attacchi in Mozambico e Afghanistan

Do you know the reason ?
thanks

laborix
Posts: 18
Joined: Sat Feb 16, 2019 3:51 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by laborix » Thu Apr 02, 2020 3:19 pm

This one is that one I tested with PHP 5.6 and PHP 7.2/7.3/7.4 and use for myself.

Code: Select all

if ($arr) {
  $id = key($arr);
  $subject = current($arr);
  next($arr);
}
… With new version 1.1 I can't see this article: ...
Please, take a look here
https://wiki.flatpress.org/en:doc:basic:upgrade
and do the step with "Rebuild the Index in Adminstration Panel - Maintain"

If you move/upgrade your blog, so the steps told in the section "Upgrade including full backup" is my prefered solution I used over years :D

Panther
Posts: 21
Joined: Mon Aug 12, 2019 11:05 pm

Re: Problem upgrade from 1.0.3 to 1.1

Post by Panther » Thu Apr 02, 2020 9:49 pm

Hi, I've update my 2 websites with your informations, all is gone well.
I have understood what happened with that article, the name is:
Mozambico: Gruppo terroristico ISIS rivendica responsabilità per gli attacchi in Mozambico e Afghanistan

With the upgrade ha lost à (in italian languate) and has become responsabilit
I have re-editated the name of article, all is gone well.

I want to tell you about a problem of version 1.0.3.....sometimes happens that numer of the articles read change and restart to 0, like 100 people have never visited the page. Now I can see with this new version if it happens again.

Thanks for all

User avatar
Arvid
FlatPress Coder
Posts: 87
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Problem upgrade from 1.0.3 to 1.1

Post by Arvid » Wed Apr 15, 2020 1:00 pm

Hi,

thanks for reporting this bug. I commited the fix with 622a0d8, it will be part of FlatPress 1.2.

Glad it works now (thanks for your help, laborix!), but you should at least consider changing to a current PHP version. 5.3 is waaay outdated and may be a potential security risk. And if you're unlucky, new versions of your software or their plugins may not support PHP 5 anymore, which makes updating stuff always tricky.

General advice (as laborix wrote): Before changing anything at your FlatPress instance, always do a backup of the whole FlatPress folder. Thus, if anything goes wrong, you can just delete the complete blog and copy it back from your backup.

Panther wrote:
Thu Apr 02, 2020 9:49 pm
I want to tell you about a problem of version 1.0.3.....sometimes happens that numer of the articles read change and restart to 0, like 100 people have never visited the page. Now I can see with this new version if it happens again.
Yes, please let us know if this still happens.

All the best,
Arvid
Helpful FlatPress links: Project blog 📝 - FlatPress wiki 📖 - FlatPress@Twitter 🐦
Stay up to date with our feeds: Forum RSS feed 📜 - Project blog RSS feed 📜


🇩🇪 Habe aktuell für meinen Arbeitgeber hier im Ruhrgebiet eine Stelle zu besetzen! 🇩🇪
- Softwareentwickler (Webanwendungen) - unbefristet, sofort

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests