• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Cannot reproduce Error if you don't set a padding on User Text Block

Jake B.

Well-known member
#1
If you don't set a padding (or leave it blank) on User Text Block you'll get an error (assuming you have debug mode on) because of the following CSS:

Code:
.messageUserBlock .userBanner
        {
            display: block;
            margin-bottom: 5px;
            margin-left: -{xen:calc '@messageUserText.padding-left + 6'}px;
            margin-right: -{xen:calc '@messageUserText.padding-right + 6'}px;
        }
 

Lawrence

Well-known member
#2
I came across this too, but never reported it as a bug because it is related to the style and your preference. I just replaced the xen:calc with the margin I wanted, TMS handles it with no issues on updates. I chose editing the template directly instead of setting the
@messageUserText.padding-left and the right to 0 because I don't use it in my current style.
 

Mike

XenForo developer
Staff member
#3
What error are you getting specifically? I don't receive an error with that blank. It resolves to an empty string, which leads to ("" + 6) which doesn't error (in PHP 5.4 or 7 at least).
 

Jake B.

Well-known member
#4
Don't remember exactly, but I'm pretty sure it was saying that it expects a float. It only shows the error in debug mode of course. I'll try to replicate it later and get the exact error
 

Lawrence

Well-known member
#5
I tried to reproduce it and couldn't either. At the time I didn't pay much attention to it because I figured it was just me and the way I chose to set some of the style properties. I just removed the xen:calc from the CSS, and replaced it with a fixed value.

Sorry, I couldn't be more helpful, but I do recall that the xen:calc did cause an error... maybe because I put another style property in the padding field instead of an actual value?