Check whether content type exists before trying to import nodes of that type

James Andres - June 22, 2009 - 23:58
Project:Node Export
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

A small patch to fix this common issue :-).

AttachmentSize
node_export.module.type_exists.patch611 bytes

#1

danielb - June 23, 2009 - 00:22

Huh? how could you possible fix this? I don't get it.
The only thing I think that can be done is create an error msg that explains it a little better.

#2

James Andres - June 23, 2009 - 17:22

The patch just stops the node from being node_save()'ed if the content type doesn't exist. It doesn't even add an error message. But that sounds like an awesome idea!

This patch should get rid of the error messages at least.

#3

danielb - June 23, 2009 - 23:50
Status:needs review» needs work

I don't think that is a solution - your idea will just confuse the user and they will not be able to find their node, and then they will come here complaining and not even be able to provide an error message to get help with.
Plus I don't even think your patch successfully does what you say it does, because it does not do the check upon import, but upon export (and of course the type is always there on export).

#4

danielb - June 25, 2009 - 12:02
Status:needs work» fixed

I've added some code to bring up a more verbose error message.

#5

System Message - July 9, 2009 - 12:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.