user warning: Unknown column 'language' in 'where clause' query: SELECT * FROM path_redirect WHERE path = 'admin/reports/updates' AND (language = 'de' OR language = '') ORDER BY language DESC LIMIT 0, 1 in /var/www/servers/mfbfoto/sites/all/modules/path_redirect/path_redirect.module on line 235.

Comments

dave reid’s picture

Status: Active » Fixed

Run update.php. :)

jkatinger’s picture

Did that several times...no joy!

dave reid’s picture

Status: Fixed » Postponed (maintainer needs more info)

Ok, go to update.php, and manually select '6101' from the 'path_redirect' option under 'Select versions' and then run. Not sure why the update did not work for anyone. Worked just fine on all of my websites.

bennos’s picture

Status: Postponed (maintainer needs more info) » Fixed

also worked for me.

think can be marked as fixed.

Paul Iliano’s picture

Status: Fixed » Active

I had the same error "user warning: Unknown column 'language' in 'where clause' query: SELECT * FROM path_redirect WHERE path = 'admin/reports/updates' AND (language = 'en' OR language = '') ORDER BY language DESC LIMIT 0, 1 in /home/ilianone/public_html/sites/all/modules/path_redirect/path_redirect.module on line 235."

Indeed, I had forgotten to run update.php (sorry), but did so immediately after seeing that error, not selecting a specific update.
Update.php report screen threw up the error "user warning: Can't DROP 'path'; check that column/key exists query: ALTER TABLE path_redirect DROP KEY path in /home/ilianone/public_html/includes/database.mysql-common.inc on line 417." and lower on the same screen "Update #6101 * Failed: ALTER TABLE {path_redirect} DROP KEY path".

So I came to drupal.org and found this issue thread. As advised here above, I ran update.php again this time selecting specifically update 6101. Now I have even more errors:
* user warning: Can't DROP 'path'; check that column/key exists query: ALTER TABLE path_redirect DROP KEY path in /home/ilianone/public_html/includes/database.mysql-common.inc on line 417.
* user warning: Duplicate column name 'language' query: ALTER TABLE path_redirect ADD `language` VARCHAR(12) NOT NULL DEFAULT '' in /home/ilianone/public_html/includes/database.mysql-common.inc on line 298.
* user warning: Duplicate key name 'path_language' query: ALTER TABLE path_redirect ADD UNIQUE KEY path_language (path, language) in /home/ilianone/public_html/includes/database.mysql-common.inc on line 403.

and

Update #6101

* Failed: ALTER TABLE {path_redirect} DROP KEY path
* Failed: ALTER TABLE {path_redirect} ADD `language` VARCHAR(12) NOT NULL DEFAULT ''
* Failed: ALTER TABLE {path_redirect} ADD UNIQUE KEY path_language (path, language)

Using phpmyadmin I can see the 'path' field in table path_redirect and see it contains the paths. Should I simply drop this field (I'm hesitant because it contains the paths)? Or do something else?

Many thanks in advance for any help as I'm stuck,
Paul

todd nienkerk’s picture

I also experienced this error when I installed the module. Here are the two errors from installation:

• user warning: Table 'path_redirect' already exists query: CREATE TABLE path_redirect ( `rid` INT NOT NULL auto_increment, `path` VARCHAR(255) NOT NULL, `redirect` VARCHAR(255) NOT NULL, `query` VARCHAR(255) DEFAULT NULL, `fragment` VARCHAR(50) DEFAULT NULL, `language` VARCHAR(12) NOT NULL DEFAULT '', `type` SMALLINT NOT NULL, `last_used` INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (rid), UNIQUE KEY path_language (path, language) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /PATH/public_html/includes/database.inc on line 515.
• user warning: Unknown column 'language' in 'where clause' query: SELECT * FROM path_redirect WHERE path = 'admin/build/modules' AND (language = 'en' OR language = '') ORDER BY language DESC LIMIT 0, 1 in /PATH/public_html/sites/all/modules/path_redirect/path_redirect.module on line 235.

Disabling, uninstalling, and re-enabling the module resulted in no errors.

dave reid’s picture

@Paul: No, don't drop the path field, it's very much a required column. The error you saw referred to a database index on the path field that happens to be called 'path'.

@Todd That sounds like you had path_redirect installed at one point but never uninstalled it to remove the table. The only time the module should try and CREATE TABLE is during a first-install/enable. :/

Not sure why everyone's having problems. I updated for 6.x-1.0-beta1 to 6.x-1.0-beta3 on all my sites with no problems. If you don't run update.php right away, you'll get an error about an undefined 'language' column, but there's really not something that can be helped since we needed to add multilingual support.

Paul Iliano’s picture

Thanks Dave.

Can you please advise what I need to do now, so that I can move on and put my site in production again?

Should I try to drop that database index called 'path'? If so, how do I do that?

Or is it OK to do nothing and just disregard the error messages?

Something else?

Many thanks in advance,
Paul

dave reid’s picture

@Paul If everything updated successfully, you should have an index called path_language (NOTE: this is different from the actual database's columns named path and language). If you do, then you don't need to do anything.

Paul Iliano’s picture

Status: Active » Fixed

Thanks Dave. Indeed, I have an index called 'path_language', plus an index called 'rid'.

So it seems all is well. I think the issue can be closed now, so I'll do so.

Thanks very much for your help!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.