Well I may be totally screwed, but perhaps some knowledgeable person out there can save my butt. Please. I seem to have lost the content type "page" such that it doesn't show up in the listing of content types (/admin/content/types) and the listing of contents from admin/content/node shows my page nodes are there but the 'type' column for them is empty where it should say 'page.'
Here's how I messed up... I was creating custom content types by templating off the 'page' type, using export/import. I.e. I exported the 'page' type, modified the name, type, and description, and imported it back as a newly created node type. The first three went great. Then I foolishly incorporated a single quote (') into the name and description (not the type) and got an error about the script being in error. Which of course it was, since the script uses single-quote characters to delimit strings and I placed one into the middle of a string, because I was cutting and pasting without noticing the content. Doh!
But apparently the content type import function tried to run the script/macro and broke the core 'page' type in the process. I've appended the beginning of the offending import text, where the mistake was made. Stupid error, I know. :(
The pages are displaying OK, but obviously my database is damaged. The 'content_type_page' in my DB looks OK, but I am not knowledgeable enough with Drupal to know where else to look or what the damage might look like. Does anyone know how to fix this without me having to retrieve my last backup and be out 10 hours of work?
Waiting hopefully,
Eric
$content[type] = array (
'name' => 'Page, Zira'at',
'type' => 'page_ziraat',
'description' => 'A <em>page</em> is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page. This content type is specifically for Zira'at',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'revision' => true,
'promote' => false,
'sticky' => false,
),
'upload' => '1',
... (cut)
Comments
additional info
I also checked the node_type table, and 'Page' (which is the first line) looks just like 'Story' below it, except for the different name and description, so I'm guessing the damage isn't there.
found the problem (I think)
Well I gave up on fixing the DB and restored from an earlier one (a day and a half of work down the drain). So then I start importing my new page-variation nodes and on the very first one I once again lose my 'page' node type even though it added the imported variant apparently fine. No errors reported. So maybe it wasn't the unescaped single-quote that caused the problem after all, I think.
I restore the database again (this time I have a backup from immediately before I begin trying to import new node types), and try my next set of imported variants. These are based on a custom 'news' event that I created from scratch based loosely on the 'story' node type. All five variants get imported just fine. Hmm.
The only significant difference I can find between the export/import script for my page variants and my news variants is the "old_type" and "orig_type" lines. The "old_type" is "page" for the exported page, and "news" for the exported new node type. But the "orig_type" is "page" for the exported page and empty (just two single-quotes next to each other) for the news node type I created from scratch. You can see the excerpt below from the "page" node type export.
So I set the "orig_type" to empty single-quotes like my exported "news" node type, changed "name" and "type" to the values for the new page variant, and imported. Ta da! I imported another four variants just fine.
Lesson learned: When making node type variants by exporting a core node type and modifying the "name" and "type", also remove the "orig_type" value to keep from losing your core node type. Oh... also, make backups more often.
P.S. At least I think that's what fixed the problem. Perhaps someone with Drupal core knowledge will be able to correct me, but as of now I have working node type variants and my core node type page, so I'm happy.
Original version straight from the exported "page" node type:
New page variant properly modified:
Thx
Thx, this saved me some heartache
Lee Rowlands
I just got burned by this too...
Same thing just happened to me.
I went in to the database, and manually cleared the orig_type values for all my custom content types.
(I left Page, Story, Blog, and Webform alone.)
I cleared the cache to clean up my admin menu, and Page was back in business.
-- Jason
Thank you!
Thank you!
Me too
I think this is either a bug or a very poorly chosen default setting.
Thank you very much -- saved
Thank you very much -- saved me!