Would it be possible to automatically port to Drupal also the attachments from the Joomla! content?

Comments

borazslo’s picture

StatusFileSize
new5.54 KB

Here a small submodule what I have done. Only for a start point. For very developers only.

- you must have a file field called "field_attachment"
- the uri of the files is not good yet
- it's not a beautifull code

ParisLiakos’s picture

Status: Active » Needs review

hey, good job thanks:)

i will set this to needs review so other users of this module can check if it works well and if everything is well, i will make the corrections needed to adhere to drupal coding standards and commit your work:)

you can post future updates here!
cheers

borazslo’s picture

StatusFileSize
new4.72 KB

Here a better version. It should be OK.
- In the settings page you can set the name of the field to import in.
- And also you can set the folder to copy the files in. (Yes this module also copy the files.)

borazslo’s picture

Please check line 52 of joomla_attachments.batch.inc!

It works for me, but my drupal and joomla tables are in the same database. Is it okay?

db_set_active('joomla');
$attachments = db_query("SELECT a.*,jc.nid FROM ".variable_get('joomla_prefix')."attachments a JOIN joomla_content jc ON jc.jcontentid = a.parent_id ORDER BY a.id LIMIT 10 OFFSET $offset")->fetchAll();
 db_set_active();
pdcrane’s picture

If this still needs review I'd be happy to test it out on our Joomla import.

Is it already in the latest dev release, or should I apply the patch manually?

ParisLiakos’s picture

the zip in #3 is a standalone module:)