1

I'm trying to migrate rows from a Joomla K2 table.

The issue happens when I add the 'fulltext' field to the field list on my select inside my migration class. This field is a medium text field with html inside. The error only happens when I put this field in the query.

The error is like so:

Migration failed with source plugin exception: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'fulltext FROM j3_k2_items n WHERE (catid IN ('43', '45', '46', '51', '68', '7' at line 1,

I have set $this->source = new MigrateSourceSQL($query, array(), NULL, array('map_joinable' => FALSE)); but it didn't help.

Any ideas? I don't know what to do.

1

Ok, just found the problem.

I was using this select:

$query = $this->getConnection()->select('j3_k2_items', 'n')
  ->fields('n', array('id', 'title', 'fulltext'))
  ->condition('catid', array(43, 45, 46, 51, 68, 72, 109, 117),'IN');

but the array inside the fields was the problem. When I removed it:

$query = $this->getConnection()->select('j3_k2_items', 'n')
  ->fields('n')
  ->condition('catid', array(43, 45, 46, 51, 68, 72, 109, 117),'IN');

Which was the same as doing a "SELECT *" the error gone and the migration worked!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.