2009-08-11, 02:59 PM
This comes up occasionally, so I'll write this so people know how to fix it (and so I can quickly find it too ).
Sometimes, the master copy of a template can be deleted. The master template is basically the default template, what you compare to on a Diff Report, and what is reverted to when you revert an edited template to default. Sometimes, the template may just disappear from the list of template (as if it's unedited, the default will be being used, so if it's been deleted, it won't show up anywhere), and sometimes, you may see the name of the template in blue text, because the template is showing up as being a custom template, as it doesn't have a master.
Going to ACP > Templates & Style > Templates > Add Template > will not work because this will just add a new custom template, even if you use the same name as the affected default template. To fix this, you need to run this query:
You only need to change the name and content value. The name is simply the name of the affected template, and the content is, unsurprisingly, the template itself. You can get this from a test forum or localhost installation. Make sure it is actually the default template. It will just cause more issues in the long run if you put a modified template into this query. Also remember to escape ' and " in the template by changing them to \' and \"
Keep the -2 as it is, as it's a default MyBB template. It will usually be fine to keep the version as 1400, as we just need to get it added back into the database. However, you can find the appropriate version and use that if you want to.
Then, the template should be working as usual.
Finally, if anyone has any idea how they actually manage to do this, could you let me know. Sometimes it seems to happen when installing plugins, and there was a bug in versions up to and including 1.4.7 that made it possible to do this, but other than that, I'm not sure how people manage it; it would be great if we can figure out how it happens.
Sometimes, the master copy of a template can be deleted. The master template is basically the default template, what you compare to on a Diff Report, and what is reverted to when you revert an edited template to default. Sometimes, the template may just disappear from the list of template (as if it's unedited, the default will be being used, so if it's been deleted, it won't show up anywhere), and sometimes, you may see the name of the template in blue text, because the template is showing up as being a custom template, as it doesn't have a master.
Going to ACP > Templates & Style > Templates > Add Template > will not work because this will just add a new custom template, even if you use the same name as the affected default template. To fix this, you need to run this query:
INSERT INTO mybb_templates
(title,template,sid,version)
VALUES
('name',
'content',
'-2',
'1400');
You only need to change the name and content value. The name is simply the name of the affected template, and the content is, unsurprisingly, the template itself. You can get this from a test forum or localhost installation. Make sure it is actually the default template. It will just cause more issues in the long run if you put a modified template into this query. Also remember to escape ' and " in the template by changing them to \' and \"
Keep the -2 as it is, as it's a default MyBB template. It will usually be fine to keep the version as 1400, as we just need to get it added back into the database. However, you can find the appropriate version and use that if you want to.
Then, the template should be working as usual.
Finally, if anyone has any idea how they actually manage to do this, could you let me know. Sometimes it seems to happen when installing plugins, and there was a bug in versions up to and including 1.4.7 that made it possible to do this, but other than that, I'm not sure how people manage it; it would be great if we can figure out how it happens.