?
avatar vtamara
vtamara
9 Sep 2015

Trying to edit a Purity III template I get an error:

error-1-duplicar-template

Trying the SQL in psql I see:
diagnostico-error-1-duplicar-template

The type of the field published of the table dyv_menu is smallint that cannot be compared with true in PostgreSQL.

I see two possible solutions:
1. Altering the table to change the type of published to become boolean
2. Changing the query to be something like a.published <> 0

¿Which one is better?

avatar vtamara vtamara - open - 9 Sep 2015
avatar vtamara
vtamara - comment - 9 Sep 2015

According to http://stackoverflow.com/questions/1942586/comparison-of-database-column-types-in-mysql-postgresql-and-sqlite-cross-map in MySQL there is not BOOLEAN but TRUE is mapped to 1 and FALSE is mapped to 0.

Then I guess the condition could be a.published IN ('1')

avatar vtamara vtamara - change - 9 Sep 2015
Title
Not duplicating template using PostgreSQL. Wrong type in "a.published IN (true)"
Not editing template using PostgreSQL. Wrong type in "a.published IN (true)"
avatar zero-24 zero-24 - change - 9 Sep 2015
Labels Added: ?
avatar vtamara
vtamara - comment - 9 Sep 2015

In the same condition a.published is compared with -2. In several other places of the code it is used as an integer, for example in ./administrator/components/com_contact/views/contacts/tmpl/default_batch.php it says <?php if ($published >= 0) : ?>.

Then I guess the best is to mantain its type as smallint and just change the query.

avatar vtamara vtamara - reference | 3728505 - 9 Sep 15
avatar vtamara vtamara - change - 17 Sep 2015
Title
Not editing template using PostgreSQL. Wrong type in "a.published IN (true)"
Not editing Purity III template using PostgreSQL. Wrong type in "a.published IN (true)"
avatar vtamara
vtamara - comment - 17 Sep 2015

It is a bug in T3 Framework, proposing solution there and closing here

t3framework/t3#423

avatar vtamara vtamara - change - 17 Sep 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-09-17 14:43:12
Closed_By vtamara
avatar vtamara vtamara - close - 17 Sep 2015

Add a Comment

Login with GitHub to post a comment