node_clone: disable by node type

GiorgosK - February 14, 2007 - 19:59
Project:Node clone
Version:5.x-1.0-beta
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

it actually gets cloned but the original node does not have those images anymore (you have to upload them again)

is that a bug or by design ?

using drupal5.1 and latest CCK and node_clone

#1

pwolanin - February 14, 2007 - 21:07

This module does not take any special account of CCK, it just calls core API functions.

In general (because of how uploaded files are handled - each associated with a single node) it can't really work well with file/image attachments without specialized code.

Try this patch: http://drupal.org/node/110294#comment-197033

The alternate method of cloning seems to work better for some in terms of uploaded files.

#2

GiorgosK - February 14, 2007 - 21:47
Category:bug report» feature request

Thanks pwolanin

so this is turn into a feature request for the node_clone

#3

moshe weitzman - April 20, 2007 - 19:16
Title:node_clone: CCK imagefield is not cloned properly» node_clone: disable by node type

i would like to be able to not ofer cloning on certain node types - the ones that always use imagefield in my case.

#4

pwolanin - April 20, 2007 - 19:49

@Moshe- that seems like a reasonable work-around for problematic node type. I'll look into it.

#5

pwolanin - April 29, 2007 - 20:04
Status:active» needs review

Attached patch is against the DRUPAL-5--2 branch for this module. Follows more or less the template in og.module.

AttachmentSize
clone_permitted_1.patch 2.64 KB

#6

moshe weitzman - April 30, 2007 - 01:20

code looks sane to me. i think you can compact a bit with node_get_types('names'); which returns an array suitable for form options. also, you have a type - search for 'ehre'

#7

pwolanin - May 4, 2007 - 23:13

Ok, I think this is good to go.

@Moshe - which branch of the module are you using? Also, I noticed a bug, of sorts, in OG where you must exclude at least one node type from the "Audience targetting system. " (also a typo there). Maybe you can use the same method for OG (patch to follow)?

AttachmentSize
clone_permitted_2.patch 2.95 KB

#8

pwolanin - May 4, 2007 - 23:29

see issue w/ patch for og: http://drupal.org/node/141491

Also, in this patch changed "None" to "none" per core usage.

AttachmentSize
clone_permitted_3.patch 2.98 KB

#9

pwolanin - May 4, 2007 - 23:32

Also a patch for the DRUPAL-5 branch

AttachmentSize
clone_permitted_DRUPAL-5_3.patch 3 KB

#10

pwolanin - May 4, 2007 - 23:34

once more with capitilization fix too.

AttachmentSize
clone_permitted_DRUPAL-5_4.patch 3.2 KB

#11

moshe weitzman - May 5, 2007 - 02:06

i am using DRUPAL-5 branch.

i will look into the og issue.

#12

pwolanin - May 5, 2007 - 02:31
Status:needs review» fixed

Ok, the last relevant patches committed to both the DRUPAL-5 and DRUPAL-5--2 branches.

@Moshe - I'd appreciate if you have time if you could look at this latter branch- the module works by a very different mechanism. It just populates the node form rather than using node_save(). I'm thinking about making this the default download.

#13

Anonymous - May 19, 2007 - 02:31
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.