#1 November 21, 2019 11:18am

Pendulum
Member
Registered: November 21, 2019
Posts: 2

Update to 4.2.28 or 4.4.7

Hello,

I've recently inherited a BigTree site form one of our new clients and having some trouble when updating from 4.2 to 4.4.7 with images. Specifically something going on with the {staticroot} prefix that's in the database, is no longer replaced by the correct image path. Is anyone able to shed some light here? Any tips appreciated smile

Here are examples of the image paths as they come through on the frontend / admin areas:
<img class="slide-img" src="{staticroot}files/callouts/crop_screenshot-2019-11-11-at-204238.png" alt="">

Many thanks

Offline

#2 November 25, 2019 9:52am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Update to 4.2.28 or 4.4.7

I don't believe there were any changes between 4.2 and 4.4 with how translation of staticroot functions but I could be wrong. Is $bigtree["config"]["static_root"] set in your environment.php file properly?

Offline

#3 November 25, 2019 11:01am

Pendulum
Member
Registered: November 21, 2019
Posts: 2

Re: Update to 4.2.28 or 4.4.7

Hey timbuckingham,

Thanks for the reply! We have the below definition:
$bigtree["config"]["static_root"] = "/";

Note the database has the following string '{staticroot}' without the underscore, Im new to big tree so not sure if that's the norm. Are you able to give a brief description of how it works if you know? E.g the expected result is '{staticroot}' is replaced with $bigtree["config"]["static_root"] - currently learning the tools and patterns in BigTree and any info helps. And if by chance you know if there was a major update at some point for the static_root - I can look at those change logs to help us diagnose.

Thanks for the help

Offline

#4 November 25, 2019 11:07am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Update to 4.2.28 or 4.4.7

{staticroot} is the correct token to be stored in the database. There's a method of BigTreeCMS that replaces tokens ({wwwroot} {staticroot} and their variants for multi-domain setups) with the actual config value: https://www.bigtreecms.org/developers/c … ativeRoots

I usually have static_root set to the full domain path but in theory "/" should work fine as well. If the data is coming out of the database directly through a SQL query and isn't being run through a BigTreeModule method (e.g. "get", "getMatching", etc) then it's not going to have tokens decoded. You'll need to run BigTree::untranslateArray on the database record to get internal page links and tokens properly decoded for display.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.