After upgrading from 6.x-1.0rc1 to 6.x-1.0 I've got the following error message at the update result page.

user warning: Unknown column 'n.language' in 'where clause' query: SELECT DISTINCT f.field_name FROM

_content_node_field f, _content_node_field_instance i WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL) AND ( f.field_name = i.field_name AND f.type = 'serial' AND i.type_name = 'image') in serial.inc on line 49. I think the db_rewirte_sql in serial.inc line 49 function parse in multilanguage setups a WHERE clause which needs the node table referenced in the sql statement. This statement is called in function _serial_rename_tables.

Comments

kirsh’s picture

Assigned: Unassigned » kirsh
Status: Active » Needs review
StatusFileSize
new11.94 KB

Please try the attached fix.

Note: update.php has to be run because this new version changes the schema.

geek-merlin’s picture

@kirsh: can you roll a patch?
see: http://drupal.org/patch

ad-thanks-vance!

FranciscoLuz’s picture

StatusFileSize
new1.53 KB
new2.08 KB
new7.91 KB

Please find attached the .patch files generated from thread #1.

The changes made by kirsh seem to have fixed the problem described on this issue ( column 'n.language' ) but now when enabling any module (admin/build/modules) I get this:

user warning: Unknown column 'i.type' in 'where clause' query: SELECT f.field_name FROM content_node_field f, content_node_field_instance i WHERE f.field_name = i.field_name AND f.type = 'serial' AND i.type = 'image' in ...\sites\all\modules\_cck\serial\serial.inc on line 51.

Are you folks able to give any light on this? :) Cheers

geek-merlin’s picture

@kirsh, is it possible to separate the bugfix from additional patches you did?
that might brighten the life of the maintainer as well as that of helpful folks.

geek-merlin’s picture

well, just notices you *are* the maintainer.

geek-merlin’s picture

@francisco: yes this *is* a bug, as of the schema it must be "i.type_name" (may not make sense, but schema sais it).

strange that you get that at module enable time (really any module?) because that line should only fire when a content type is renamed.

geek-merlin’s picture

ok fixed that (untested!) on top of kirsh's version from #1 and put it in my sandbox for all that have interest or further patches:
http://drupal.org/sandbox/axel.rutz/1154028

FranciscoLuz’s picture

@axel.rutz #6
Well then it might be cache related. I mean, perhaps the error is not issued on every module enabling process but it gets printed out because it is cached or something. Just a guess!!!
When I get a chance I will re-test it.

zilverdistel’s picture

subscribing

Whenever I clear my cache with drush, I get the following (twice):

WD php: Unknown column 'n.language' in 'where clause' [error]
query: SELECT f.field_name FROM content_node_field f, content_node_field_instance i WHERE (n.language ='nl' OR n.language ='' OR n.language IS NULL) AND ( f.field_name = i.field_name AND f.type = 'serial' AND i.type_name = 'blog') in /home/diederik/Openbaar/dev/wonen-en-werken.statiklabs.be/sites/all/modules/serial/serial.inc on line 49.
WD php: Unknown column 'n.language' in 'where clause'

geek-merlin’s picture

it would really be great to understand under what conditions multilang (which module?) rewrites the sql.
my naive guess would that it checks if the node table is involved... but that is clearly not the case in serial.inc:49.

edit: here is a good explanation what happens. as we do not have a "db_rewrite_sql" in that function anymore i ask you, zilverdistel, to check if your source is the same as that in the link above. (if not you owe us a beer ;-)

zilverdistel’s picture

@axel.rutz: I guess I owe you a beer after all. Removing the db_rewrite_sql call fixed the problem with drush cc all.

Has this been committed in dev allready?

mojzis’s picture

please, please ... can we have a release with this solved ...

cyberwolf’s picture

Subscribing.

brutuscat’s picture

#7 @axel.rutz Thanks, your fix seems to be working fine. It also fixed the cache issue. I applied it into my code with serial fields working and it continues to work without issues. I haven't tried renaming the field though.

zilverdistel’s picture

Status: Needs review » Reviewed & tested by the community

I think this can be marked RTBC ...

colan’s picture

Issue tags: +i18n

Adding tag.

colan’s picture

Assigned: kirsh » Unassigned
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I don't see a patch here with the most recent fix. Is this even still a problem? It looks like at least some of the code is already in the dev version. Can someone confirm? I no longer have D6 running.

If it's still a problem, please provide the individual fix in patch format that applies to the current dev branch.

colan’s picture

Status: Postponed (maintainer needs more info) » Fixed

As nobody's complained, I'll assume that this is no longer an issue.

Status: Fixed » Closed (fixed)
Issue tags: -i18n

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

tusik’s picture

Issue summary: View changes

This unfortunately continues to be an issue. After updating core to 6.30, I am getting the same error message for i.types 'blog' and 'panel'

tusik’s picture

Status: Closed (fixed) » Active
mustanggb’s picture

Status: Active » Closed (outdated)