Elxis CMS Forum

Support => Installation => Topic started by: mesalti on January 15, 2007, 19:42:15

Title: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: mesalti on January 15, 2007, 19:42:15
After installing Elxis (amazing cms I must say) and entering for administration, I ask to see the pre-existent poll. However, I reveive this error:

"ERROR: column "m.language" must appear in the GROUP BY clause or be used in an aggregate function"

I installed Elxis for 4 times, but allways with this error.
I have Postgresql 7.4 and the charset for elxis database was LATIN1 and in another attempt UNICODE.

Can anyone help me please?
Thank you very much!

Best regards,
Mesalti - Portugal
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: eliasan on January 15, 2007, 19:46:56
Greetings to Portugal from Greece!

Hello mesalti,

I guess that you have upgraded from 2006.3 to 2006.4 without performing the database upgrade. That is why you get this error. Your database does not have the required column.

Please download and install Updiag tool (you can find it at Elxis Directory) and perform the upgrade in the right way.

For more info, please do not hesitate to ask.
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: mesalti on January 15, 2007, 19:56:50
Grretings from Portugal!

Actually, I installed "Elxis CMS 2006.4" directly... and the table elx_polls has already "language" varchar(250) field. (with pgAdminIII)

I think you were relating this, right? But I think this is not the problem  ???

Thank you!

Best regards,
Mesalti - Portugal
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in
Post by: eliasan on January 15, 2007, 19:59:57
Hi Mesalti,

I hope that is not a problem directly related to Postgres. Please give us a little time to check it and reproduce it.

Meanwhile, could it be possible to test your installation with MySQL?

Thank you,
Ilias
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: mesalti on January 15, 2007, 20:03:57
Well,

I do not have MySQL installed  :(
I'm not thinking install on it, however, if I'll install I will replay the result to you.

Think you for helping me :)

Best regards,
Mesalti - Portugal
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: eliasan on January 15, 2007, 20:57:39
I think that it is a bug related with Postgres support. I will open a ticket.

Thank you for your help on making Elxis better!
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in
Post by: datahell on January 15, 2007, 23:46:49
Welcome mesalti,
It is easy to solve this issue.

Some people have make complaints about some "strange" to them SQL querries in Elxis with lot of "GROUP BY" fields. This is due to Postgre support. I guess we missed that check in 2006.4 for PostgreSQL. To solve this issue you must add in the relevant querry a "GROUP BY m.language" line or extend an existing GROUP BY by adding m.language. Please give us the full error output including file name and line number to tell you exactly where you should add this GROUP BY field.

Notice: Elxis DEMANDS that your database should be encoding as UTF-8 as it is a trully multilingual CMS which is only supported by a multilingual charset! And this is utf-8, not latin1!
Title: Re: ERROR: column "m.language" must appear in the GROUP BY clause or be used in an a
Post by: mesalti on January 16, 2007, 13:46:00
Hi,

My problem right now is time :(

However, I have found the problem. Like said above (datahell), the query string must have "m.language" in GROUP BY clause.

Solution:

        $query = "SELECT m.*, u.name AS editor,"
        . "\n COUNT(d.id) AS numoptions"
        . "\n FROM #__polls AS m"
        . "\n LEFT JOIN #__users AS u ON u.id = m.checked_out"
        . "\n LEFT JOIN #__poll_data AS d ON d.pollid = m.id AND d.text <> ''"
        . $filter
        . "\n GROUP BY m.id, m.title, m.voters, m.checked_out, m.checked_out_time,"
    . " m.published, m.access, m.lag, u.name, m.language"

Just put ", m.language" at the end of query SELECT, in file "./administrator/components/com_poll/admin.poll.php" at line 100

Thank you everyone for supporting me.
And good work for Elxis Team, they are developping an amazing CMS!!!

Best regards,
Mesalti

PS - Portugal is discovering Elxis ;)