Node Relativity can't handle underscores in content type names

jjalocha - May 18, 2009 - 15:27
Project:Node Relativity
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Inside 'Link operations' a 'Create new Solution' appears, but it doesn't creat the correct content type. Actually, it doesn't create a link at all.

My set-up:

  • Drupal 6.12
  • Relativity 1.2

I am using custom content types, created with 'admin/content/types/add':

  • Conflict (content_ct)
  • Solution (solution_ct)

In this case, it should be possible to attach one solution to different conflicts.

Node relativity, Regular settings:

  • Node types that can be involved in relationships: Conflict & Solution

Options for Conflict (conflict_ct) nodes:

  • Parental Ordinality: none
  • Allowable Child Node types: Solution

Options for Solution (solution_ct) nodes:

  • Parental Ordinality: one or more
  • Allowable Child Node types: [nothing]

Symptom
The following links are correctly displayed in 'Link operations':

  • Create new Solution (node/add/solution_ct/parent/2)
  • Attach existing Solution (relativity/listnodes/solution_ct/parent/2)

But the 'Create new solution' does not send me to a 'Create Solution' page, but to a generic 'Create content' page, that looks like 'node/add' without the option of adding a solution_ct. (Note, that it is correct not to show 'solution_ct' in this list, because I disabled "orphan" nodes for this type in Parental Ordinality. But I shouldn't be shown this list in this context, in the first place!)

When I create one of the listed content types, I get exactly that, a new node of this other content type, and it does not get linked to the "parent" node (which is correct, because I didn allow these types in 'Allowable Child Node types').

I've tested this with different user roles, all have the rights to create 'solution_ct' content.

#1

jjalocha - May 18, 2009 - 15:45

I found something strange that might cause this bug:

The name on the "real" link that creates a node on my site is somehow mangled with. It replaces the underscore for a dash: node/add/solution-ct.

The Node relativity module is attempting to create a new node with the straight content type name, without replacement: node/add/solution_ct/parent/2

Hope this helps!
Cheers,
Jerzy

#2

jjalocha - May 18, 2009 - 19:19
Title:Impossible to 'Create new' node» Node Relativity can't handle underscores in content type names

I've just been able to confirm that this bug has to do with underscores in the content type names:

  • The way Node relativity tries to add a node doesn't work: node/add/solution_ct/parent/2
  • Simply modifying this address according to the way Drupal handles them, creates the node, as desired: node/add/solution-ct/parent/2

I've changed the title of this bug report, to better reflect the nature of this issue.

#3

mike_tt - June 30, 2009 - 15:42

Busted! ;)

This module kicks so much ass, but I was pulling my hair out due to this bug. I concur. I changed my content type to not have underscores, and everything seems to work peachy.

I suppose this isn't "critical" but I think that a short-term fix in the form of a note somewhere letting people know that they can't have underscores in the content type names is pretty crucial.

Thanks for all the work on this module.

#4

mike_tt - June 30, 2009 - 15:58

I created this book page in the Node Relativity documentation, explaining that you need to remove underscores from content type names for the time being. Hope that was OK!

http://drupal.org/node/506364

#5

threexk - July 2, 2009 - 12:00

Have a fix for this issue that I hope to post as patch today.

#6

livido - July 3, 2009 - 09:22

I created a patch and used it well.

AttachmentSize
relativity.patch 1.14 KB

#7

svdoord - July 9, 2009 - 11:11
Version:6.x-1.2» HEAD
Status:active» needs review

I encountered this problem as well, and I created patches for both 6.x-1.x-dev and HEAD, which I'm attaching. I'm setting the version to HEAD, hoping that this will be picked up sooner :)

AttachmentSize
Patch for 6.x-1.x-dev 1 KB
Patch for HEAD 1.06 KB

#8

darius - July 11, 2009 - 02:59
Status:needs review» fixed

Fixed in 6.x-1.x-dev. For 5, please submit a patch against 5.x-2.x-dev, not HEAD. Thanks.

#9

SocialNicheGuru - July 18, 2009 - 13:24

has this actually been included? I downloaded dev 7/11 and I still had to apply the patch.

The patch in #7 did not solve my issue :(

#10

SocialNicheGuru - July 18, 2009 - 13:30

Patch #6 did work :) thanks!

#11

lhernon - July 21, 2009 - 21:19

Both patch #6 and the module are wonderful! Thanks.

Laura

#12

System Message - August 4, 2009 - 21:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.