mybb / mybb

MyBB is a free and open source forum software.

Home Page:https://mybb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exporting Installed Themes and reimporting causes corrupt Error

FuckingToasters opened this issue · comments

Full Error (shown in an red box)

The following errors were encountered:

MyBB could not find the theme with the file you uploaded. Please check the file is the correct and is not corrupt.

The Theme File isn't corrupt as the same issue happen when i import the theme again, export it and try to import the exported version.

Would be nice if anyone could help me there.

commented

Does the same happen for other themes, or MyBB installations? Can you attach the theme package here?

Does the same happen for other themes, or MyBB installations? Can you attach the theme package here?

The Theme i'm using is a paid one which goes by the name "Emerald Extended". I don't have the permission to distrubute it.

While I'm not sure about the cause of the issue, I was able to consistently replicate it on my sites that use myBB as well. I have not tried on a fresh install, and will see if I can do that soon.

Essentially, I'd export a theme out of the myBB admin panel, and immediately be unable to re-import it. I would consistently get the above error mentioned. After inspecting the XML file, I found a consistent set of fixes for when I encountered the issue.

For those searching, this is the fix that has worked every time for me:

Steps to Fix

  1. Export the theme as usual
  2. Open the XML file it gives you in a text editor
  3. Remove the line that says <?xml version="1.0" encoding="UTF-8"?>, and remove any blank lines that come before the starting <theme tag.
  4. Scroll to the very bottom of the file. You will find an unfinished closing tag: </the. Fix it to </theme>
  5. Save the XML file
  6. Import the Theme. Will work flawlessly now

Observations

Consistent issues with the XML files were:

  • Importer did not like the prepended <?xml> tag
  • The ending "" was consistently getting cut off to "</the"