(I had previously commented about this at http://drupal.org/node/1461982#comment-6008926 , but it seems to have been lost in the shuffle. So I'm opening a separate ticket for it.)

The avatar import fills in the website address even when you try to leave it blank, then uses that instead of the directory you set for it to import from, which obviously fails.

Eg; even though I left the website address field blank, it ignores this and puts in "http:///" anyway when you try to save settings, which it then prepends to the avatar location, leaving something like "http:///sites/default/files/pictures/phpbb/images/avatars/upload", which fails.

I ended up having to just use the live website because I didn't feel like trying to dig through the code to figure out why it was doing this.

I'd much rather not have to use the live site, as I'm hoping/guessing that it is a lot faster without all the web server request overhead?

Comments

phreadom’s picture

I think I've fixed the problem myself.

Around line 294 in phpbb2drupal.pages.inc

  $domain = $form_state['values']['phpbb2drupal_files_domain'];

  if (drupal_strlen($domain) > 0 && !preg_match('/^http(s)?:\/\//i', $domain)) {
    $domain = "http://{$domain}";
  }
  if (drupal_strlen($domain) > 0) {
      if (drupal_substr($domain, -1) != '/') {
          $domain .= '/';
      }
  }
  $form_state['values']['phpbb2drupal_files_domain'] = $domain;

I basically told it not to add a / at the end unless it was missing AND the URL wasn't empty.

It seems that before it would add the / because of course there wasn't one at the end of an empty URL, and then it would add the http:// before it because there was already a / as the URL.

unitedwallabies’s picture

Try the patch I just posted under the new issue: Allow non-http(s) URLs as source of files.

With it you can refer to your local path as file:///....