Page 1 of 2

Problem upgrade from 1.0.3 to 1.1

Posted: Fri Mar 27, 2020 2:05 am
by Panther
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Tue Mar 31, 2020 5:28 pm
by laborix
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Tue Mar 31, 2020 11:42 pm
by Panther
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Tue Mar 31, 2020 11:54 pm
by Panther
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.

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Wed Apr 01, 2020 4:39 pm
by laborix
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.

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Wed Apr 01, 2020 8:47 pm
by Panther
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Wed Apr 01, 2020 9:05 pm
by Panther
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Thu Apr 02, 2020 3:19 pm
by laborix
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Thu Apr 02, 2020 9:49 pm
by Panther
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

Re: Problem upgrade from 1.0.3 to 1.1

Posted: Wed Apr 15, 2020 1:00 pm
by Arvid
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 pmI 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