Notice: Undefined index: summary_callbacks in feeds_ui_mapping_settings_form() (line 667 of sites/all/modules/feeds/feeds_ui/feeds_ui.admin.inc).
Warning: Invalid argument supplied for foreach() in feeds_ui_mapping_settings_form() (line 667 of sites/all/modules/feeds/feeds_ui/feeds_ui.admin.inc).

Comments

webservant316 created an issue. See original summary.

webservant316’s picture

Issue summary: View changes
megachriz’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new927 bytes
new1.43 KB

The problem is that the Ubercart Addresses processor doesn't invoke the hooks to alter the targets, which Feeds assumes that every processor does. The attached patch should solve this issue for Feeds 7.x-2.0-beta1 or newer.
Also attached a patch with tests only which should demonstrate the bug (and fail tests).

The last submitted patch, 3: uc_addresses-feeds-hook-targets-2602514-tests-only.patch, failed testing.

webservant316’s picture

super thanks.

yeah I figured out that feeds was not tight enough. Seems like the better fix would be in feeds if we could :-)

Your patch is working for me, but I also tried this in line 667 of feeds_ui.admin.inc.

	if (isset($target['summary_callbacks'])) {
		foreach ($target['summary_callbacks'] as $callback) {
		$summary[] = call_user_func($callback, $mapping, $target, $form, $form_state);
		}
	}
megachriz’s picture

Well, in this case the Ubercart Addresses processor didn't invoke the hooks to add or alter mapping targets, which I think every Feeds processor should do anyway. The Feeds integration in Ubercart Addresses could be improved more by the way, for example all the country targets could be merged into one target with target configuration. Same applies for the zone targets. But since I have my hands full on Feeds now and I don't actively use Ubercart Addresses myself anymore, I do not find it worth to change that.

Thanks for reporting back that the solution worked for you. I commit the fix later.

webservant316’s picture

I could not get the uc_addresses feeds import to work. It kept mismatching my addresses with the user account. I did have 'aid' selected as unique and also 'uid' was properly assigned.

I bagged the effort and just imported a table into 'uc_addresses' directly through myphpadmin.

megachriz’s picture

You shouldn't map to "Address ID" unless you want to update existing addresses. Ubercart Addresses sets address id's by itself and the API (thus when importing new addresses via Feeds) doesn't allow to set that directly.

Note that when you import addresses directly into phpmyadmin you may get errors in the user interface if:

  • Address names are not unique per user (but multiple empty address names per user are allowed).
  • An user has multiple default billing addresses.
  • An user has multiple default shipping addresses.
webservant316’s picture

hmmm didn't know that about the 'aid' field. yes good points about potential problems. none of cases apply to me, so I am good. thanks.

  • MegaChriz committed 5fede44 on
    Issue #2602514: by MegaChriz: fixed FeedsUcAddressesProcessor doesn't...
megachriz’s picture

Status: Needs review » Fixed

Committed #3.

Status: Fixed » Closed (fixed)

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