Importer bug

Project: 
Ubercart
Category: 
bug report
Priority: 
normal
Status: 
active

Getting this error when importing:

Fatal error: Call to a member function on a non-object in /home2/melissa/public_html/sites/all/modules/ubercart/uc_importer/uc_importer.module on line 948

Which looks like this:

<?php
          $class
->name = (string)$class_data->name[0]->data();
?>

in function uc_importer_import.

In the documentation '/store/classes/class/description' is marked as not required so perhaps a check of its existence before trying to read it from the XML is needed here.

Re: Importer bug

And again on line 971. with:

<?php
(string)$product_data->nid[0]->data()
?>

since nid won't be in newly imported data

also the importer remains PHP5

As you have used the 'file_put_contents' function which is PHP5 only.

Re: Importer bug

Also this is a fundamental problem:

<?php
$id_map
['products'][(string)$product_data->id[0]->data()] = $product->nid;
?>

Where does $product_data->id[0]->data() come from if its a new import? It seems to also be undocumented, and is it required if we have:

$product_data->unique_hash[0]->data() // which also includes nid

and

$product_data->model[0]->data()

before it. Perhaps there are 2 too man primary keys for the one product to track?

Re: Importer bug

The class description and the product nid in the unique hash were mistakes. Since I got rid of the PHP 4 version of the importer, I also fixed the line using file_put_contents() to be more backwards-compatible.

I'm sorry the product id was undocumented, but that's because I never thought it would be needed. Since other modules will be able to hook into the import process, there needs to be a way for them to keep track of the products in the XML. Just like the vocabularies and categories, the products should have some kind of ID in the source system that can be referenced elsewhere in the XML. The original importer didn't need a product id, but other modules, like uc_product_kit, would.

Re: Re: Importer bug

I guess I thought thats what the 'unique_hash' was about. Is the product ID the same as the Node ID?

Re: Re: Re: Importer bug

Only if it was generated by the Übercart exporter. If the XML is based on an osCommerce installation, it would be the products_id. When the importer goes through the products, it figures out what the new node ids are and matches them to the <id> elements of each product. Then, when that id shows up in the XML later, it can tell which node to affect.

The unique_hash allows one Übercart site to send product updates to another. Because the node ids can be different between the two sites, the unique_hash is used to decide if any nodes are already in the system. If they are, their node ids are matched up with the correct <id> and the node data is updated.

this is great...now what?

what do i do? i think everythings been messed up, becuase i cant do nothing, in fact, im locked out of my own site. i dont know whare to go to fix this.
can someone please help me!!

ahhhhhh

kasperjames

-----------------------------------
updated:
what happoned with me was that i used fantastico in my control panel and ended up fallowing the manual installation steps, even after reading each and every read me file, i had to uninstall it and fallow the basic: http://install.ubercart.org/ location to install it, because it was automated this way it ended up overwritting the fantastico installation. unload it from here! i know this seems like a cheap issue but it was a headache for me.

im just a beginner.

make sure, while installing the ubercart that you have a window open and add the location target databases in your host database wizard. and contact your webmaster to get any needed sql/ftp loading information.

this helped me alot.

hope this helps anyone else with this issue.

my other prior issue was actually a log in error that i had which might have been partially due to the manual install.

now, in attempts to put up a "site offline" message, the account log in might actually work.

thanks.