Steps to reproduce:

  • Install Drupal and configure it to another language (eg. portuguese)
  • Install content_copy.module
  • Import a new node type at admin/content/types/import

The following error will happen:

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<create> ( vid int unsigned NOT NULL default '0', ' at line 1 query: CREATE TABLE content_type_<create> ( vid int unsigned NOT NULL default '0', nid int unsigned NOT NULL default '0', PRIMARY KEY (vid) ) /*!40100 DEFAULT CHARACTER SET utf8 */ in E:\xampplite\htdocs\drupal-5.0\includes\database.mysql.inc on line 172.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<create> ADD COLUMN field_reference_value longtext' at line 1 query: ALTER TABLE content_type_<create> ADD COLUMN field_reference_value longtext in E:\xampplite\htdocs\drupal-5.0\includes\database.mysql.inc on line 172.
    * Uma escolha ilegal foi detectada. Por favor contacte o administrador do site.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in E:\xampplite\htdocs\drupal-5.0\sites\all\modules\cck\content_admin.inc on line 890.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in E:\xampplite\htdocs\drupal-5.0\sites\all\modules\cck\content_admin.inc on line 891.
CommentFileSizeAuthor
#7 content_copy.patch1.07 KBsmk-ka
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

elgrad.info’s picture

Priority: Normal » Critical

Subscribing.

I have same problem with CCK & Advanced Profile.

brahms’s picture

Subscribing.

I also have the same problem with CCK & Advanced Profile. Setting the interface language to english makes the content import work.

elgrad.info’s picture

Status: Active » Postponed (maintainer needs more info)

Thank you.
It decided my issue.

smk-ka’s picture

Title: content_copy.module does not work with Drupal set to another language » Import fails when Drupal set to a language other than English
Component: content.module » General
Assigned: Unassigned » smk-ka
Status: Postponed (maintainer needs more info) » Needs review

Tracked this down to two locations, in both cases t() is erroneously applied to the key of a select form field. This makes the if-conditions to always fail, and results in the content type never being created (to be precise, Drupal tries to create a content table content_type_<created>, which is not a valid SQL table name. Not hard to image that subsequent operations go wrong, causing the whole import operation to fail.)

yched’s picture

Component: General » content_copy.module

file under the new 'content_copy.module' component

magico’s picture

Status: Needs review » Active

no patch attached.

smk-ka’s picture

Status: Active » Needs review
FileSize
1.07 KB

grml...

brahms’s picture

Status: Needs review » Reviewed & tested by the community

@smk-ka:

I have just tested the patch from comment#7 with Content Copy 5.x-1.7. It solves the issue for the 5.x-1.7 revision of the module and so I set the status to patch (reviewed and tested by the community). Please include the bugfix into the 5.x-1.x-dev version and the next 5.x-1.8 release of the module.

In release 6.x-2.0-rc3 and probably in 6.x-2.0-dev of the module there are also the 2 comparisons with t('<create>') instead of '<create>'. Please fix those too.

Thank you.

yched’s picture

Status: Reviewed & tested by the community » Fixed

Committed to D5 and D6. Thanks !

Anonymous’s picture

Status: Fixed » Closed (fixed)

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