I can't make reverse direction work on node reference in views fusion widget. I get a fusion with empty column 'using' in views fusion widget.

Here's what I did:
1. Patched nodereference.module (cck 5.x-1.4, Drupal 5.0) with cck_nodereference_views_fusion_47.patch (see http://drupal.org/node/123482)
2. Patched nodereference.module with cck_nodereference_views_fusion_47_2.patch (onto previously patched version)
3. Run update.php
4. Created 'referenced' content type (title field only) and 'referencer' content type (title field and nodereference field to 'referenced'). Added some content of both types. Added table views for both types (Node: Title field only).
5. In views fusion widget I could fuse successfully 'referencer' (primary) with 'referenced' view using "straight" Node Reference. But when I tried to fuse 'referenced' as primary with 'referencer' using Node Reference - reverse direction something goes wrong and views fusion widget reports new fusion with 'using' column empty.

I attached error message (when trying to view referenced table view) concatenated with my nodereference.module contents.

CommentFileSizeAuthor
error_and_nodereference.module_0.txt19.23 KBCentEur
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Project: Content Construction Kit (CCK) » Views Fusion
Version: 5.x-1.4 » 5.x-1.x-dev
Component: nodereference.module » Code
CentEur’s picture

Status: Active » Fixed
CentEur’s picture

Title: Reverse direction doesn't work on node reference in views fusion widget. » Long reference field names break generated SQL query.
Version: 5.x-1.x-dev » 5.x-1.0
Assigned: CentEur » Unassigned
Category: support » bug
Status: Fixed » Active

I've finally nailed the problem described above. The SQL query generated is broken because for some reason the generated names are cut short. It's 'node_data_field_referencja_rever' instead of 'node_data_field_referencja_reverse'. The bug dissapears when I shorten the reference field name (referencja -> ref1). The bug appeared only in reverse direction fusion, because it's the added '_reverse' that made the generated name too long.

Mac Clemmens’s picture

Any idea as to why this happens? I have many fields with long names that are getting cut short... Do you know where I could fix this?

Mac Clemmens’s picture

I FIGURED IT OUT! :) Finally. After a miserable morning of trying to diagnose this issue.

I had long field names and tried to create a views fusion. Much to my dismay I got nothing but errors. (Similar to what is described above.) The culprit is in the Database! In the views_fusion table, column "uses" has a varchar length of 32 which is insufficient. Change it to 64 or 128 and it works great. Because "uses" stores the field names, and because field names can be longer than 32 characters, increasing this field size solves the problem.

gnosis’s picture

+1 to solution in #5 - fixed me right up after mind-boggling fusion failure

bneel’s picture

+ 1

U are the man

liquidcms’s picture

never hurts to check the issue queue.. i posted this same issue and the solution last night.. :)

joachim’s picture

+1.
Nice job!

Be nice to see a fix in a new version :)