XF 2.1 BackBlaze adapter error

yes. i noticed something similar. xenforo adds ?1588607352 like values to the end of the profile image urls. blackblaze is not loading these images. images load fine clean image url. have filed a bug report with backblaze. i am not even sure why xenforo adds the values at the end of profile image urls. attachments worked fine for me in forum posts though. didn't check backend. are user pics loading fine at your end?
 
yes. i noticed something similar. xenforo adds ?1588607352 like values to the end of the profile image urls. blackblaze is not loading these images. images load with the end parameter. have filed a bug report with backblaze. i am not even sure why xenforo adds the values at the end of profile image urls. attachments worked fine for me in forum posts though. didn't check backend. are user pics loading fine at your end?

Fix:

$config['externalDataUrl'] = function($externalPath, $canonical) { return 'https://s3.us-west-000.backblazeb2.com/bucketname/data/' . $externalPath; };

Screenshot_2.webp
 
right. the added parameter at the end of image url breaks the image on backblaze. hopefully this is something that can be resolved by backblaze. or maybe xenforo developers can suggest a workaround. but this is a good start. no need for manual hacks!

do send feedback here: b2feedback(at)backblaze.com
 
I've examined integration codes I hope we will fix it with some changes.

PHP:
    public function getAvatarUrl($sizeCode, $forceType = null, $canonical = false)
    {
        $app = $this->app();

        $sizeMap = $app->container('avatarSizeMap');
        if (!isset($sizeMap[$sizeCode]))
        {
            // Always fallback to 's' in the event of an unknown size (e.g. 'xs', 'xxs' etc.)
            $sizeCode = 's';
        }

        if ($this->gravatar && $forceType != 'custom')
        {
            return $this->getGravatarUrl($sizeCode);
        }
        else if ($this->avatar_date)
        {
            $group = floor($this->user_id / 1000);
            return $app->applyExternalDataUrl(
                "avatars/{$sizeCode}/{$group}/{$this->user_id}.jpg?{$this->avatar_date}",
                $canonical
            );
        }
        else
        {
            return null;
        }
    }

?{$this->avatar_date}
 
I've examined integration codes I hope we will fix it with some changes.

PHP:
    public function getAvatarUrl($sizeCode, $forceType = null, $canonical = false)
    {
        $app = $this->app();

        $sizeMap = $app->container('avatarSizeMap');
        if (!isset($sizeMap[$sizeCode]))
        {
            // Always fallback to 's' in the event of an unknown size (e.g. 'xs', 'xxs' etc.)
            $sizeCode = 's';
        }

        if ($this->gravatar && $forceType != 'custom')
        {
            return $this->getGravatarUrl($sizeCode);
        }
        else if ($this->avatar_date)
        {
            $group = floor($this->user_id / 1000);
            return $app->applyExternalDataUrl(
                "avatars/{$sizeCode}/{$group}/{$this->user_id}.jpg?{$this->avatar_date}",
                $canonical
            );
        }
        else
        {
            return null;
        }
    }

?{$this->avatar_date}

@OyuncularSehri
You can excluded avatar_date

If you change your data / internal_data stores you have to manually sync the contents of both of these

@Jake B.
Did you try to sync?
Also, what was the result?
 
editing core xenforo code is never a good idea though. would wait for some updates from xenforo devs though this should logically be fixed by b2 developers because this issue does not exist on s3 or spaces.

update: just got a response from b2 developers. they recommend modifying the app to remove the url parameter. lol. i can't even.

Possible solution... Use the regular b2 URL in the config file? That should work I assume.
 
Last edited:
editing core xenforo code is never a good idea though. would wait for some updates from xenforo devs though this should logically be fixed by b2 developers because this issue does not exist on s3 or spaces.

update: just got a response from b2 developers. they recommend modifying the app to remove the url parameter. lol. i can't even.
Calm down bro, I made it!!!
 

Attachments

haha. tried the above route. works. instead of using the s3 endpoint url for $externalPath... just use the regular backblaze url https://f001.backblazeb2.com/file/BUCKETNAME/data/. no addon required.
 
sitemap is another thing which has issues with b2. it is creating versions of the files while they are being created. and then old sitemap files are not disappearing. in just a couple of days, i had a folder with 100s of files (including versions) and multiple finished files.

i do not even have versioning enabled on this bucket. not sure what's going on. and looks like i cannot redefine the sitemap folder in config.php. this is going to be annoying.

checked if removal of deleted attachment is working. it does seem to work. so that's nice. would love to hear experiences of other users here. i have kept a copy of my cloud folder on aws and i am going to rclone regularly. in case b2 manages to break this integration during one of the updates.
 
Last edited:
Top Bottom