Hi,

I'v set up 2 sites with uc and uc_addresses. Everything seemed fine until I noticed that if you have multiple countires you can choose when registering for an account it won't load the zones.

The default country (that loads first) loads the zones fine, regarding which country I use, but as soon as I try to change country it get stuck on loading the zones.

Does anyone have an idea what causing this? Is it fetching with ajax? I've tried to disable caching with no luck...

(Changing countries when you are in the ordering process works just fine, its just when registering for an account it get stuck)

Thankful for any help! /Mats Jacobsson

Comments

matsjacobsson’s picture

I found the problem... The reason zones are updating is that I don't have the "access content" permission ticked for anonymous users. Once I tick this it workes fine...

But this is still a problem for me because I don't want anonymous users to be able to access the content.

Anyone have an Idea how to fix this?
/Mats

matsjacobsson’s picture

A quick fix was to turn on "Content Permissions" module, tick the "access content" permission for anonymous users and let everything else be turned off..

megachriz’s picture

It is because of this code, right?

  $items['uc_js_util/%'] = array(
    'title' => 'JS utilities',
    'page callback' => 'uc_store_js_util',
    'page arguments' => array(1),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );

Ubercart Addresses makes use of the API Ubercart provides, so I think you should file this issue in the Ubercart issue queue if you want a different permission for the zone updating.

Another possible solution is to write a custom module and implement a hook_menu_alter() and a hook_perm() in it:

<?php
/**
 * Implementation of hook_menu_alter().
 *
 * Change the access setting for Ubercart javascripts callbacks.
 * (e.g. zone updating)
 *
 * @param array $items
 * @return void
 */
function mymodule_menu_alter(&$items) {
  $items['uc_js_util/%']['access arguments'] = array('access zones');
}

/**
 * Implementation of hook_perm().
 *
 * @return array
 */
function mymodule_perm() {
  return array('access zones');
}
?>
megachriz’s picture

Status: Active » Closed (won't fix)

The root of this problem lies with Ubercart, not Ubercart Addresses. It can be fixed with writing your own module (see #3) or by filing an issue in the Ubercart issue queue.

Issue closed.