2.8.29 -> 2.9.4 pgsql error after update

Please report bugs here!

Moderator: Thorsten

Post Reply
andrew
Posts: 2
Joined: Mon Aug 08, 2016 6:46 am

2.8.29 -> 2.9.4 pgsql error after update

Post by andrew »

Greetings from New Zealand,
I've been using phpMyFAQ for about 18 months now and upgraded without problems in the past, but this latest one has failed me.

Updating from phpMyFAQ 2.8.29 to 2.9.4, update.php completed without error and the Online verification check is good, but when I leave the /admin/ zone I get a blank page. With Debug on, the source shows the following errors loading index.php
phpMyFAQ warning
[2]: pg_query(): Query failed: ERROR: column fd.visits does not exist
LINE 43: fd.visits DESC
HINT: Perhaps you meant to reference the column "fv.visits". in /var/www/html/faq/inc/PMF/DB/Pgsql.php on line 112

phpMyFAQ warning
[2]: pg_fetch_object() expects parameter 1 to be resource, boolean given in /var/www/html/faq/inc/PMF/DB/Pgsql.php on line 142

Navigating to /admin/index.php I can login, see and edit faqs and configuration, although there is an error with the changelogs.
(PMF_Faq->getChangeEntries() line 545. PMF/Perm/Medium.php (looks like it should be ORDER BY revision_id instead of ORDER BY id)

Additional note, I did have to copy modernizr.min.js from /js/ to /js/libs/ before it stopped giving a 404.

Is the update script failing to alter tables (I have restored the database and the faq folder a number of times to redo the update) or is there an error in the faq source?
I've rolled back to 2.8.29 for the team, but can clone the database and faq to test potential solutions.

Best Regards,
Andrew

Configuration: Apache 2.4 / PHP 7.0 / PostgreSQL 9.5 on Ubuntu 16.04
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: 2.8.29 -> 2.9.4 pgsql error after update

Post by Thorsten »

Hi,

this should fix your issue: https://github.com/thorsten/phpMyFAQ/co ... 644a43947d

Thanks for the feedback!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
andrew
Posts: 2
Joined: Mon Aug 08, 2016 6:46 am

Re: 2.8.29 -> 2.9.4 pgsql error after update

Post by andrew »

Thanks Thorsten,

Implementing that change to showAllRecordsWoPaging() did remove the error but I was still stuck with a blank index page.
When viewing the source it looked like a perfect page without any errors, but nothing displayed on the page (as if the DOM was hidden).
Thinking it must be a CSS issue I renamed /assets/template/defaults and copied over the 2.9.4 version instead of the preserved 2.8.29 one.
Now the index loads fine, and the search works, but I couldn't read entries.
(artikel.php was displaying an error about "ORDER BY relevance_thema" until I disabled relevance support in the search configuration)

Finally, to get the changelog displaying I changed file: inc/PMF/Faq.php -> getChangeEntries [line 2576] -"ORDER BY id DESC" +"ORDER BY revision_id DESC"

Thanks again, we now have the new faq up and running.

Best Regards,
Andrew.
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: 2.8.29 -> 2.9.4 pgsql error after update

Post by Thorsten »

Hi,

thanks, I fixed the issue with the query.

The template issue can be fixed by removing this line: https://github.com/thorsten/phpMyFAQ/bl ... ex.tpl#L40

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply