Piwigo.org

You are not logged in. (Register / Login)

Announcement

Post a reply

Write your message and submit

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

Gijs
2010-07-02 13:00:09

Gijs wrote:

Aha!

Thanks for the patch!

vi  maintain.inc.php and then

:%s/\"/\'/g

does the same :-). I tried that... however, this brings me to a new error


Parse error: syntax error, unexpected T_STRING in plugins/LocalFilesEditor/maintain.inc.php on line 30


in spostgresql-8.3-main.log : I *also* keep seeing this. I expect it is a similar type or related.

CEST STATEMENT: 
        SELECT id AS id,username AS username
        FROM piwigo_users
          ORDER BY CONVERT(username,CHAR)

I should learn to read more closely. It is VERY warm, maybe that counts as an excuse. I overlooked the
escape \ in front of the '.

:%s/\"/\\\'/g  would have done it..

It works now.

The

CEST STATEMENT: 
        SELECT id AS id,username AS username
        FROM piwigo_users
          ORDER BY CONVERT(username,CHAR)


however remains..

Gijs
2010-07-02 12:55:52

Aha!

Thanks for the patch!

vi  maintain.inc.php and then

:%s/\"/\'/g

does the same :-). I tried that... however, this brings me to a new error


Parse error: syntax error, unexpected T_STRING in plugins/LocalFilesEditor/maintain.inc.php on line 30


in spostgresql-8.3-main.log : I *also* keep seeing this. I expect it is a similar type or related.

CEST STATEMENT: 
        SELECT id AS id,username AS username
        FROM piwigo_users
          ORDER BY CONVERT(username,CHAR)

nicolas
2010-07-02 12:31:26

Gijs wrote:

Ah! Thanks. What can I do to fix this error locally? Replace some or all " by '  in files in /plugins/LocalFilesEditor?

If you can read and apply a diff file, here it comes :

Code:

index 35aca4b..0f1d31e 100644
--- a/plugins/LocalFilesEditor/maintain.inc.php
+++ b/plugins/LocalFilesEditor/maintain.inc.php
@@ -27,7 +27,7 @@ function plugin_install()
 
   $query = '
 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
-VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");';
+VALUES (\'LocalFilesEditor\' , \'off\' , \'LocalFiles Editor plugin parameters\');';
 
   pwg_query($query);
 }
@@ -36,7 +36,7 @@ function plugin_uninstall()
 {
   global $prefixeTable;
 
-  $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="LocalFilesEditor" LIMIT 1;';
+  $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param=\'LocalFilesEditor\' LIMIT 1;';
   pwg_query($query);
 }

Don't forget that apply that kind of patch prevents you to automatically upgrade to future releases.

Gijs
2010-07-02 11:42:34

nicolas wrote:

Gijs wrote:

I could be posting this in the wrong thread. But this is one of the errors I get, when trying to install the local files plugin. Have not been able to find the bug ..

Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^ in /(path) include/dblayer/functions_pgsql.inc.php on line 122
INSERT INTO piwigo_config (param,value,comment) VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");
ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^

It's not related to AS keyword but it's also a PostgreSQL issue. PostgreSQL and SQLite (and probably others database engines) wanted fields values to enclosed by single quotes and not double ones. The error reads strange because PostgreSQL engine thinks "LocalFilesEditor" is a field and not a value. double quotes are use for fields to protect reserved words like "count" or things like that.

I created the new [Bugtracker] bug 1755 Feel free to do it yourself next time.

Ah! Thanks. What can I do to fix this error locally? Replace some or all " by '  in files in /plugins/LocalFilesEditor?

nicolas
2010-07-02 10:03:13

Gijs wrote:

I could be posting this in the wrong thread. But this is one of the errors I get, when trying to install the local files plugin. Have not been able to find the bug ..

Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^ in /(path) include/dblayer/functions_pgsql.inc.php on line 122
INSERT INTO piwigo_config (param,value,comment) VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");
ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^

It's not related to AS keyword but it's also a PostgreSQL issue. PostgreSQL and SQLite (and probably others database engines) wanted fields values to enclosed by single quotes and not double ones. The error reads strange because PostgreSQL engine thinks "LocalFilesEditor" is a field and not a value. double quotes are use for fields to protect reserved words like "count" or things like that.

I created the new [Bugtracker] bug 1755 Feel free to do it yourself next time.

Gijs
2010-07-02 07:47:51

I could be posting this in the wrong thread. But this is one of the errors I get, when trying to install the local files plugin. Have not been able to find the bug ..



Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^ in /(path) include/dblayer/functions_pgsql.inc.php on line 122
INSERT INTO piwigo_config (param,value,comment) VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");
ERROR: column "LocalFilesEditor" does not exist LINE 3: VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plug... ^

Gijs
2010-07-02 07:41:30

nicolas wrote:

Gijs wrote:

I will not move to 8.4 soon.. But I am slowly including all AS where needed..

I think it will hapen soon because next release (9.0) comes !

Not that hung up on following the latest. I use postgresql for more than just piwigo. Not keen on migrating all databases at this point in time.

Gijs wrote:

I'm guessing:

SELECT t.*, count(*) counter
SELECT t.*, count(*) AS counter

is the next one..

Il open a ticket in our bug tracker : [Bugtracker] bug 1754. Don't hesitate to post queries here after if I forgot somes !

Hi Nicolas!

Thanks for this.

so far I have added 'AS' in a few places. Did not keep a record, but will start doing that now.

these are the files I've edited so far:

config_default.inc.php
include/functions_user.inc.php
include/functions_notification.inc.php
include/functions_tag.inc.php

I'm running into loads more errors, with tags, with rss feed, with adding photo's .... I'll try and keep more detailed notes. I hoped a few quick edits would suffice, but ..

nicolas
2010-07-01 21:15:25

Gijs wrote:

I will not move to 8.4 soon.. But I am slowly including all AS where needed..

I think it will hapen soon because next release (9.0) comes !

Gijs wrote:

I'm guessing:

SELECT t.*, count(*) counter
SELECT t.*, count(*) AS counter

is the next one..

Il open a ticket in our bug tracker : [Bugtracker] bug 1754. Don't hesitate to post queries here after if I forgot somes !

Gijs
2010-07-01 17:24:33

I will not move to 8.4 soon.. But I am slowly including all AS where needed..

I'm guessing:

SELECT t.*, count(*) counter
SELECT t.*, count(*) AS counter

is the next one..

nicolas
2010-07-01 16:53:07

Gijs wrote:

I managed to fix the error by making three changes in the include/functions_user.inc.php



line 681
<    $query = 'SELECT c.id cat_id, global_rank';
>    $query = 'SELECT c.id AS cat_id, global_rank';

line 684
<   MAX(date_available) date_last, COUNT(date_available) nb_images
>   MAX(date_available) AS date_last, COUNT(date_available) AS nb_images

This allows me to complete the setup. I assume I will find other errors however :-/

Hope this helps others.

Yes you're right. The AS keyword is mandatory for older release of PostgreSQL. (older that 8.4)

nicolas
2010-07-01 16:51:45

Kult wrote:

nicolas wrote:

I cannot reproduce the problem. Can you help me to find it. When did you have the problem ?

During the installation process. I've set up all fields [Basic configuration, Database configuration, Admin configuration] click on the [Start Installation] button and I get this error.

I also try the query in psql and I also get the same error, until I place the AS keyword.

It seems that AS keyword is optionnal since release 8.4 and I used release 8.4.4.  So two solutions :

1) add the AS keyword in all queries where it's needed
2) change PostgreSQL required version to 8.4

I think the first one is the better one.

Gijs
2010-07-01 16:27:19

I managed to fix the error by making three changes in the include/functions_user.inc.php



line 681
<    $query = 'SELECT c.id cat_id, global_rank';
>    $query = 'SELECT c.id AS cat_id, global_rank';

line 684
<   MAX(date_available) date_last, COUNT(date_available) nb_images
>   MAX(date_available) AS date_last, COUNT(date_available) AS nb_images

This allows me to complete the setup. I assume I will find other errors however :-/

Hope this helps others.

Gijs
2010-07-01 16:03:46

trying to make hay of the error message: notice this:

piwigo_categories as c LEFT JOIN piwigo

should that not be

piwigo_categories **AS** c LEFT JOIN piwigo



The docs of postgresql 8.3 seem to suggest SELECT can use aliases.

Gijs
2010-07-01 15:47:23

And this is using postgresql 8.3.8-1 from Debian. This is also on a clean system..

Kult
2010-07-01 11:20:04

nicolas wrote:

I cannot reproduce the problem. Can you help me to find it. When did you have the problem ?

During the installation process. I've set up all fields [Basic configuration, Database configuration, Admin configuration] click on the [Start Installation] button and I get this error.

I also try the query in psql and I also get the same error, until I place the AS keyword.

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013