MyBB Community Forums

Full Version: Prefixes lost during update
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi there,

I just upgraded from 1.6.3 to 1.6.4 and noticed none of my prefixes were showing. Checking the thread prefixes section of the ACP, it says there are none set up on the forum, when there were definitely 30 or so before the upgrade. I ran a back up before the upgrade but did not disable any plug-ins. Why might my prefixes be gone and is there anyway I can get them back?

Thanks, Reece.
You'd have to selectively restore the lost data from your backup without overwriting anything else...

You could restore the threadprefixes table (and only that one) from your backup to replace your empty one, and then go through the threads table of your backup, find all entries that have a value for prefix, and run a query for those:

UPDATE mybb_threads SET prefix=$value WHERE tid=$tid

It could probably be done more directly in the database if you managed to restore the backed up threads table under a different name, something like:

UPDATE mybb_threads a SET a.prefix=(SELECT prefix FROM backup_threads b WHERE a.tid=b.tid) WHERE a.prefix=0 AND a.tid in (SELECT tid FROM backup_threads)

I haven't tested these queries myself though. Maybe they will work, maybe not.

Make another backup before attempting this... if you're not good with editing files and databases, better not attempt it at all, you can easily cause more damage when messing around Wink
Try going to ACP > Tools & Maintenance > threadprefixes > Rebuild Cache > See if that does anything. The backup wouldn't have deleted them, it doesn't run any code to do that.
Ah, okay, that makes a lot more sense than my suggestion then. I didn't expect the cache as culprit since other Admin CP modules (such as forums) display properly even when the cache is not okay.

Maybe the Admin CP thread prefixes page should forcibly rebuild the cache. It's not that expensive and you don't visit the prefix page that often, but it's confusing as hell when it shows up as empty for some reason even while there are prefixes available.
I'd have thought the ACP pages would query the database directly actually like other ACP modules, but either way, that's probably the cause.
Unless I'm looking in the wrong place (the Cache Manager), threadprefixes doesn't seem to be there...
Heh. Now that's funny. The cache manager only shows the cache (including its rebuild link) if it already exists. So you can't rebuild it if it isn't there already.

Make yourself a rebuild link. It's YOURSITE/YOURADMINCP/index.php?module=tools-cache&action=rebuild&title=CACHE&my_post_key=YOURPOSTKEY

YOURSITE will be some URL to yoursite/mybb/, YOURADMINCP the name of your admin folder (by default /admin/), CACHE will be the name of the cache (in this case threadprefixes), and YOURPOSTKEY will be something random like 4c97c10a6c3fa5f251c71dd47741701a which you'll find in lots of links of the Admin CP.

Or just copy another of the rebuild links (right click copy url), make a new tab, paste it in the address bar, and replace title=whatever with title=threadprefixes.
I copied one of the other links and replaced the title with threadprefixes, but upon pressing enter I got a 404.
You sure _all_ your files are up to date? It worked fine for me in my local install.

Does it say you're using 1.6.4 in ACP? Does it list modified or missing files in Tools -> File Verification?
Version Check says it's 1.6.4. File Verification meanwhile lists inc/class_parser.php and showthread.php as changed while there are a bunch of files missing from the install directory, which I did delete after the upgrade.
Pages: 1 2