First up, many kudos for an excellent module. It looks to save TONs of time in getting some of our older clients out of joomla and into Drupal, so thank you for your work!

I have a joomla 1.5 site that I'm trying to migrate into Drupal 7.10. (soon to be 7.12 as that was just released).
The users and taxonomy vocabs and terms import perfectly, but I'm having some issues on the content side.

This main issue is that when i run the content import, the taxonomy terms that get associated with an article don't seem to line up properly with their vocabulary on the front end. For example, I have an article in joomla that is in an "community news" section, and is category is "leading the way".

On the drupal site, there is a corresponding vocab called "community news" with the correct term in it as built by the importer, when viewing the article the term shows up properly below the article content, maps to the correct term URL, but it appears to belong to the "tags" vocabulary, and upon further inspection in the edit article screen, the term is showing up in the tags vocabulary field.

Even stranger thus: When viewing the terms list tags vocabulary through structure/vocabulary/tags there are no terms in it! (My thinking was perhaps the terms were just getting dumped into the wrong "tags" vocab)

I do have the term references fields for the correct vocabs added to the content type, and i did run the importer again after adding those fields.

Second possibly related issue, every time i re-import using the "update content" check box, the term associated with a category are duplicated. e.g. 3 imports = 3 tags show on the front end (but there are not duplicate terms in the vocab itself).

I found this in the logs, if it helps:
Notice: Undefined variable: categories in joomla_category_save() (line 201 of /public_html/sites/all/modules/joomla/joomla.batch.inc).

I'm happy to provide schema's as need be for both to help debug, and again, I appreciate your time on this module!

Thanks!

Comments

ParisLiakos’s picture

Hello, thanks for your nice words!
yes assigning every term to the tags field is leftover from the previous branch.i know its wrong and intend to fix it.

my thoughts is to import categories first and then redirect user back to settings form where he/she can assign each vocabulary to a field...
then assign the terms to these correct fields
duno if it is user friendly, but thats the best solution that comes in my mind..if you have a better idea share it.
i plan to work soon enough on this

rowbeast’s picture

I think that direction would be just fine. I'm really not sure that a 1 step solution should be expected in this system anyways. Its a complicated task importing the data, so breaking it into two or three steps would be perfectly acceptable in my opinion.

The alternative "do everything in one step" route would be to:
1. Import all vocabs and terms
2. In the setup form, you ask what type to import content items into, so technically you know what content type needs the term reference fields added to it. so you could programatically add the vocab fields to the content type
3. import the content and make the associations.

Seems like a LOT of work to me and and in my opinion, asking the user to do a couple steps instead should be just fine.

Let me know what I can do to help with this. I'm happy to write documentation/test patches etc. I've got a few migration projects coming up and I'd love to be able to use this module.

Thanks again!

ParisLiakos’s picture

Status: Active » Needs review

hmm i made a first commit.
Awaiting feedback:)

ajevans85’s picture

Just tried this in the latest version of dev. The issue I see is the fields are hard coded to be detected from JOOMLA_DEFAULT_STATIC_NODETYPE rather than content types set on the form. Below is a patch which fixes this but there is then a issue if 'Default node type for static items' and 'Default node type for content items' are different.

index 966126c..e2304ee 100644
--- a/joomla.module
+++ b/joomla.module
@@ -236,7 +236,7 @@ function joomla_admin_settings($form, &$form_state) {
 
   if (db_query('SELECT COUNT(*) FROM {joomla_categories}')->fetchField()) {
     db_set_active('joomla');
-    foreach (field_info_instances('node', JOOMLA_DEFAULT_BLOG_NODETYPE) as $field_name => $field) {
+    foreach (field_info_instances('node', variable_get('joomla_default_static_nodetype', JOOMLA_DEFAULT_STATIC_NODETYPE)) as $field_name => $field) {
       $node_fields[$field_name] = $field['label'];
     }
     $vocabularies = taxonomy_vocabulary_load_multiple(FALSE);
ParisLiakos’s picture

thanks for noticing this:)
commited the fix

ajevans85’s picture

The other thing I've just spotted is that we only display the filter options if 'joomla_categories' table in the drupal database is populated. This means that for the field filter options to display we first have to import the categories, edit the config page to map the fields and then import the content.

if (db_query('SELECT COUNT(*) FROM {joomla_categories}')->fetchField()) {

I'm not sure if we'd even need this check?

ParisLiakos’s picture

we actually need a check, to see if the vocabularies from joomla have been created.
if not you couldn't have a field that references the joomla vocabulary