MyBB Community Forums
[Pushed] Plugins' Master stylesheets deleted on core upgrade - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Pushed (https://community.mybb.com/forum-183.html)
+----- Thread: [Pushed] Plugins' Master stylesheets deleted on core upgrade (/thread-229633.html)



Plugins' Master stylesheets deleted on core upgrade - Laird - 2020-10-03

Reporting this as a bug per frostschutz's suggestion in my original thread by the same name in the Plugin Development forum. This is an only slightly edited version of that post to remove parts irrelevant to the bug report:

For a while now I've noticed that often after upgrading MyBB to the latest version, some of my plugins lose their styling.

After digging around in the code, I think I've identified why, although I haven't done any testing to confirm this.

It looks as though Master stylesheets are unconditionally deleted on line 222 of admin/inc/functions_themes.php, in the function import_theme_xml():

$db->delete_query("themestylesheets", "tid='{$options['tid']}'");

...as called on line 487 of install/upgrade.php, in the function upgradethemes():

import_theme_xml($contents, array("tid" => 1, "no_templates" => 1, "version_compat" => 1));

By "unconditionally" deleted I mean that all Master stylesheets, including those of plugins and not just those of core, are deleted. If the admin hasn't modified any of these stylesheets for any theme such that inheritance is overridden and the theme has its own copy, then the stylesheet is lost.

Is this even intended behaviour, or is it a bug, and if it is a bug, then could the fix be to add a method of marking stylesheets as either belonging to core or a plugin, and for import_theme_xml() to only conditionally delete core stylesheets, and leave plugin stylesheets alone?


RE: Plugins' Master stylesheets deleted on core upgrade - Ben - 2021-02-23

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/4265

Thanks for contributing to MyBB!

Regards,
The MyBB Group