MyBB Community Forums

Full Version: themestylesheets issue (html download of PM) after upgrading ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I recently upgraded myBB from 1.8.14 to 1.8.21 (full upgrade)

Everything seems fine, except for the "Export Private Messages" feature when selecting HTML format => CSS is not applied (see below , before/after upgrading)

[Image: 19041008404723064116194655.jpg]
(screenshot from a 1.8.14 -> 1.8.20 upgrade on a test environment, with the same issue)

I tried to analyse the php code used to display this page and found in "private.php" the following code :
$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1)); 

So it tries to retrieve the CSS with SID=1 in the themestylesheets table
Problem: before upgrading, this SID exists. After upgrading, it doesn't any more  (see below: diff before/after upgrading) :
[Image: mybb_bdd.png]

Putting back the previous SID values fixes this issue, but I wonder if there could be any other side-effects,  or if this could be a bug in the upgrade process and/or in myBB code (SID column is auto_increment and the upgrade process seems to delete/insert rows in this table) ... or if there is something wrong with my installation from the start  Smile

Thank you for your help,

JY.
For your second question:
The upgrade script will delete MyBB master style's stylesheets (tid = 1) from table themestylesheets, and then insert the latest MyBB master style' stylesheets to the table themestylesheets, loaded from ./install/resources/mybb_theme.xml.

It might cause problems if you have duplicate CSSs with the same tid = 1, the MyBB master style. Not sure.

For your first problem:
Yes, it's an internal bug of selecting a hardcoded sid = '1' stylesheet when exporting PMs in HTML.

You may open an issue addressing this bug, https://github.com/mybb/mybb/issues/new . If you don't, I will open one shortly.
Thanks noyle, I will do that.
edit : Done ! -> https://github.com/mybb/mybb/issues/3779

JY.