{"id":446,"date":"2009-03-10T09:29:04","date_gmt":"2009-03-10T08:29:04","guid":{"rendered":"http:\/\/www.dotmana.com\/index.php\/?p=446"},"modified":"2009-03-10T09:29:27","modified_gmt":"2009-03-10T08:29:27","slug":"reset-default-theme-in-drupal-without-admin-with-mysql","status":"publish","type":"post","link":"http:\/\/www.dotmana.com\/weblog\/2009\/03\/reset-default-theme-in-drupal-without-admin-with-mysql\/","title":{"rendered":"Reset default theme in drupal without admin \/ with mysql"},"content":{"rendered":"<p>You will find usefull information about this in this article: <a target=\"_blank\" href=\"http:\/\/drupal.org\/node\/200774\">http:\/\/drupal.org\/node\/200774<\/a><\/p>\n<blockquote><p><strong>Situation:<\/strong><br \/>\nEither you have installed or modified a theme that just breaks everything, or you&#8217;ve deleted the current theme without disabling it first.<\/p>\n<p>As you&#8217;ve now learned, you should have switched out of the theme via administration before destroying it, because you are left with nothing or almost nothing as a UI to work with now.<\/p>\n<p>But we can probably recover.<\/p>\n<p><strong>If you see <em>some<\/em> content but no navigation blocks<\/strong><br \/>\nWe can fix up the themes by going directly to the required pages.<\/p>\n<ol>\n<li>You&#8217;ll have to be logged on, so enter <a title=\"http:\/\/example.com\/?q=user\" rel=\"nofollow\" href=\"http:\/\/example.com\/?q=user\">http:\/\/example.com\/?q=user<\/a> in the browser. Logon as normal. (use your own Drupal path of course)<\/li>\n<li>Enter <a title=\"http:\/\/example.com\/?q=admin\/build\/themes\" rel=\"nofollow\" href=\"http:\/\/example.com\/?q=admin\/build\/themes\">http:\/\/example.com\/?q=admin\/build\/themes<\/a> (D5) or <a title=\"http:\/\/example.com\/?q=admin\/themes\" rel=\"nofollow\" href=\"http:\/\/example.com\/?q=admin\/themes\">http:\/\/example.com\/?q=admin\/themes<\/a> (D4) to see a version of the themes page. Select a valid theme (eg BlueMarine) and things should be in a state where you can continue.<\/li>\n<\/ol>\n<p><strong>If you see <em>no<\/em> content at all, maybe garbage or a totally blank screen<\/strong> or the above doesn&#8217;t work&#8230;<br \/>\nWe need to do surgery on the database.<br \/>\nIt&#8217;s easier if you choose a theme name that you know used to work, eg &#8216;garland&#8217; or &#8216;bluemarine&#8217; for D4.<\/p>\n<p>Either on the commandline, or via an administration interface (eg PHPMyAdmin) enter the following query<\/p>\n<div class=\"codeblock\"><code>UPDATE system SET status=1 WHERE name = 'garland';<\/code><\/div>\n<p>Then either:<\/p>\n<div class=\"codeblock\"><code>UPDATE variable SET value='s:7:\"garland\"' WHERE name = 'theme_default';<br \/>\nTRUNCATE cache;<\/code><\/div>\n<p><sub>Note that &#8216;s:7&#8217; refers to the length of the following string. Modify as needed. This is database surgery, tricky stuff.<\/sub><br \/>\nOR<br \/>\nIf you are using per-user themes, and you&#8217;ve just messed it up for yourself as admin, try<\/p>\n<div class=\"codeblock\"><code>UPDATE users SET theme='garland' WHERE uid = '1';<\/code><\/div>\n<p>Be careful, as getting either of those lines wrong can mess things up just as badly.<\/p>\n<p>If you see some of  the theme, but no navigation blocks, you may be able to proceed as in the first case, described above.<\/p>\n<p><strong>That didn&#8217;t work<\/strong><br \/>\nIt&#8217;s hard to guess how badly your system is damaged at this point. Did you delete the phptemplate directory?<br \/>\nTry re-uploading the entire contents of the \/themes directory from a clean distribution of the exact same version of Drupal.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>You will find usefull information about this in this article: http:\/\/drupal.org\/node\/200774 Situation: Either you have installed or modified a theme that just breaks everything, or you&#8217;ve deleted the current theme without disabling it first. As you&#8217;ve now learned, you should &hellip; <a href=\"http:\/\/www.dotmana.com\/weblog\/2009\/03\/reset-default-theme-in-drupal-without-admin-with-mysql\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-446","post","type-post","status-publish","format-standard","hentry","category-dev"],"_links":{"self":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/comments?post=446"}],"version-history":[{"count":0,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/446\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/media?parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/categories?post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/tags?post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}