Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

I support this. Are there any plans, or is there any timeframe when a Drupal-6 port might be available?

We are starting development of a new site based on Drupal-6, and nodereferrer + nodereferrer-create are requirements.

Thanks.

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

Well I'm really glad to know that you guys think I should port this to D6... I'm sry but I have a few other modules I still need to port.. If you need it so badly why not go ahead and port it?

I'll tell you what I tell most people who ask me this question... It'll get ported when I get around to it... I still haven't even released a D5 version so you may still have a bit of waiting to do.

Alice Heaton’s picture

FileSize
13.81 KB

Here's a first patch, against the 2008-Jun-10 development release.

* Doesn't integrate with views module
* Doesn't handle paging

Otherwise it seems to be working... Use at your own risk !

I'll look into porting the rest of it when I get a free time slot.... But that might not happen for a few weeks or more, so if you need the missing features don't hesitate to port them ! (If you can that is ;) )

dopry’s picture

@Anselm Heaton: Sweet. You rock! I have one question, is there a particular reason you chose more specific tests for hook_field_settings?

I'd love to see a few folks who use this module report back on whether everything is working.

Alice Heaton’s picture

" I have one question, is there a particular reason you chose more specific tests for hook_field_settings? "

Yes ; all indexes are now set by default with a empty value (to avoid undefined indexes errors) ; so testing with isset always return true - whether there was a value or not.

This is from the "Updating CCK Modules from 5.x to 6.x" [1] page :

" Field arrays are merged with the default value arrays to be sure all parts of the field and widget have indexes set so they never create undefined index errors. This means all field values will always return true to isset(), and module authors should not use isset() to test if values exist for form elements on the field settings form. Instead use is_array(), is_numeric() or similar tests. "

[1] http://drupal.org/node/191796

dopry’s picture

Status: Postponed (maintainer needs more info) » Needs review

Awesome.. (me thinks I should go dig into CCK some more again its about that time.) I've love a few reviews before I run off an commit this bad boy.

cruiz’s picture

Hi all!
I have been using this patch, and apparently works ok. The only problem is, as Anselm Heaton specified, that it does not work with views. Do you know whether this functionality will be available soon?

Best regards,

Cris

Alice Heaton’s picture

@cruiz : I will need nodereferrer for D6 released as a proper module by October, so unless someone else does it I will definitely do it between now and then. I can't see this happening in the coming 2 weeks though because I'm very busy trying to catch up flying deadlines at the moment ;) I will post an update here when I start working on it, so people don't need to ask all the time !

Flying Drupalist’s picture

Thanks for working on this. I'm going to test out nodereferrer create with the patch.

Alice Heaton’s picture

FileSize
10.44 KB

Hey, here's some progress !

I've ported the Views functionality - you get both filters and arguments, from node id (can be restrained by field name or node type). There's a little bit of redundancy between filter and argument (not sure how to factor this out using views 2) but it's clean and working :)

I've added a lot of files (because of the way Views 2.0 works, in particular since RC2) so I'm not attaching a patch here, just the whole module as a tgz.

Oh, and I've also implemented this : http://drupal.org/node/297605 because I needed it (and I think it makes sense).

Let me know (here) if there's any problems. Still need to do the paging, and then the D6 version will be complete :)

Alice Heaton’s picture

FileSize
11.02 KB

Ok, an update on yesterday's version :

  1. views filters/arguments now also include translation options, so that you can get nodes that refer to translations of the node you've given ; and translations of nodes that refer to the node you've given (all optional, of course).
  2. translation options are now conditional on 'translation' module being present
  3. translation options are now off by default

As yesterday, the whole module is included here. This file supersedes the one given in comment #10

...still need to work on that pager thing :) ...

Alice Heaton’s picture

FileSize
11.57 KB

And finally here is the version with the pager. It uses the same code as the D5 version (faking the pager_query call). I haven't tested how that behaves when there's other modules around, but it will work as well as the D5 version (which is still a dev version) did.

Main difference with the D5 version for the pager is that it asks you for the pager element. It's now possible to theme the whole item (list + pager) or just individual fields. The pager calculations are done in the whole item theme unfortunately, because the results from nodereferrer_field are cached. Will need to investigate if there's a better way of doing that.

It's not perfect :) but it has all the features of the D5 version, so I guess it's fine to do a D6 dev release ? dopry ?

As far as I'm concerned the porting is done :) People want to test it/review it ? Attached is the whole module, this supersedes previous versions.

:)

Flying Drupalist’s picture

Thanks again Anselm, no problems so far. :)

dydecker’s picture

Nodereferrer is not updating after nodereference is updated.

I created two content types, player & sport. Each of the players gets assigned a sport using nodeference. Nodereferrer correctly displays the players on the sports page. But when you edit the player & remove the sport nodereference, nodereferrer doesn't remove the player from the sport page.

Alice Heaton’s picture

@dydecker : Thanks for reporting this. Mmm, I see what is happening.

It's a caching problem ; cck 1 didn't cache the values of the fields. Nodereferrer does clear the cache of related nodes when a referrer gets updated - but in that case because the reference is removed, it doesn't see it to clear it's cache.

I'll write a fix soon, and will post it here.

jferjan’s picture

subscribing

Alice Heaton’s picture

@dyedecker : Right, well this is a bit of a complicated issue actually. I think it should be reported as an issue of it's own when the D6 version is available as a package. I can think of several ways of dealing with it, but none are satisfying and I think this requires a bit more thinking !

In the mean time, the following patch (against the module in comment #12) will solve your problem in most cases :

Index: nodereferrer.module
===================================================================
--- nodereferrer.module (revision 1374)
+++ nodereferrer.module (working copy)
@@ -412,6 +412,7 @@
  */
 function nodereferrer_nodeapi($node, $op) {
   switch ($op) {
+    case 'prepare':
     case 'insert':
     case 'update':
     case 'delete':

I'm saying "in most cases", because you can get a race condition where someone views the referenced node after you started editing the referrer, but before you saved it. In that case the referenced node won't notice it has been removed from the referrer (until the cache is cleared for another reason that is). Depending on how busy your site is, this might happen a lot, or not at all. If you are still developing your site, then this should be sufficient until a proper fix comes along !

andypost’s picture

subscribe

matherion’s picture

Anselm (and everybody else who worked on this), you are a hero!

Finally. I don't know enough PHP and practically nothing of how Drupal works below the hood (and yet I use it -shame on me, I know :-)), and I've spent hours surfing and looking for a solution to this problem in Drupal 6.4 . . .

THANK YOU!!!

(now to find out how to install that patch, but this looks promising :-))

matherion’s picture

This may be a stupid question, but does that patch in #17 just mean

add case 'prepare':

at that position in nodereferrer.module?
I just downloaded and installed both UnxUtils and Cygwin, but it seems that there's a bit more to patching than just running a commmandline utility ('patch --help' was slightly disheartening I must admit), and if I can also just add this one line in a text editor, that would save me a lot of time right now . . . I'll delete a node reference, see whether it updates, and then apply this patch, and see whether it updates then, and report back :-) [might help someone else who's as inexperienced as me]

matherion’s picture

Reporting back: alas, it's not that simple . . .

I changed the node reference of one of the nodes [the 'referring node'] that referred the node that used the nodereferrer field [the 'referred node'];
reloaded the referred node (the node that used the nodereferrer field);
and the referring node, that now actually referred to ANOTHER node than the referred node, was still in the last.

I then added the line case 'prepare': to nodereferrer.module and uploaded it, and then refreshed the referred node, but the erronous node reference did not dissappear.

(I hope it's clear :-))

I'll now try to 'really' apply the patct . . .

matherion’s picture

FileSize
355 bytes

Another update :-)

I did it the official way, and indeed, the only thing that happened was that that one line was added. Uploaded to server, nothing happened. Had the brilliant idea to disable and re-enable the module, et voila, it worked!

Patch gave me an error though; malformed line 7, he said. Apparently all lines need to be indented by one space?
Once I fixed this, patch started complaining that the patched 'unexpectedly ended midline', so I also added an empty line at the end.

I attached the result, so that all this may perhaps benefit somebody :-)

Again, Anselm, dopry, and everybody else that contirbuted to this, THANK YOU!!!

WorldFallz’s picture

Installed and tested 12 + 17. Seems to be working fine including updating nodeferrers after nodereferences have been updated (without having to clear the cache).

One thing I did notice though, when nodereferrers are empty, they list themselves as a referrer instead of being empty-- this is different from the original d5 behavior and I'm not entirely sure correct.

matherion’s picture

That is strange; here, when a node is not referred to by another node, the nodereferrer field does not list itself as a referrer; it only shows its name without content (in my case it just says

Reasons in this study:

)

In addition, this may be a stupid question, but when I try to get the referring nodes to show up in views, it gives a MySQL error. Specifically, I have a node A (of type X) which is referred to by nodes B and C (both of type Y). I have a view which shows only nodes of type A, and shows a number of fields from that node, one of them being the NodeReferrer field, which should show, for node A, the list of nodes B and C. Instead, I get an error :-)

This is my MySQL code as Views 2 shows it:

SELECT node.nid AS nid,
   node.title AS node_title,
   node.type AS node_type,
   node_data_field_target_expltheories. AS node_data_field_target_expltheories_,
   node_data_field_target_expltheories.nid AS node_data_field_target_expltheories_nid
 FROM node node 
 LEFT JOIN content_type_target node_data_field_target_expltheories ON node.vid = node_data_field_target_expltheories.vid
 WHERE node.type in ('target')
   ORDER BY node_title ASC

And this is the error I get:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS node_data_field_target_expltheories_, node_data_field_target_expltheories.' at line 4 query: SELECT node.nid AS nid, node.title AS node_title, node.type AS node_type, node_data_field_target_expltheories. AS node_data_field_target_expltheories_, node_data_field_target_expltheories.nid AS node_data_field_target_expltheories_nid FROM node node LEFT JOIN content_type_target node_data_field_target_expltheories ON node.vid = node_data_field_target_expltheories.vid WHERE node.type in ('target') ORDER BY node_title ASC LIMIT 0, 10 in C:\domains\gjyp.nl\wwwroot\interventiondesign\modules\views\includes\view.inc on line 685.

(I have the feeling that this has something to do with the underscore that is added at the end of node_data_field_target_expltheories_ . . . ? But I don't really know any MySQL, so I may be completely off :-))

I hope this is any use . . . I'll continue playing with this, and report back if I find a solution.

Flying Drupalist’s picture

Hi, can somebody post the changed package like Anselm Heaton did in 12? Thanks.

WorldFallz’s picture

@matherion - i got the error in the view as well, i hadn't gotten that far yet when I posted earlier (my bad, I hadn't noticed that views support was back in).

@Miraploy - It's only the one line change from #17 above, it's easier to just type in the changed line.

matherion’s picture

@Miraploy: just open nodereferrer.module in a text editor, scroll to line 410 (that is, I use Notepad++ in Windows XP and there it's line 410), and add a line saying:

    case 'prepare':

And you're done.

@WorldFallz: I tried to work with a computed field, by trying to just save the contents of the nodereferrer field in a computed field (I read somewhere else, sometime, that somebody tried to solve something similar like that). However, I don't manage to get anything in the computed field. Can be that it's my ignorance of PHP and the Drupal API, or can be that the nodereferrer field is not stored in the database, but created on the fly when the node is shown.

I found out that this option exists because when you create a computed field, you can choose whether you want its value to be stored in the database, or calculated 'on the fly' when the node is shown. They ('the computed field people') also say that is you want a computed field to be available in views, you have to select the option to store its value in the database.

For nodereferrer, it makes sense to not store the value in the database, because you want to update it every time the node is shown; there is not 'static' value, so to speak. This is what this patch is about, after all; to make sure that the value is recalculated every time a node is shown.

So, I thought, when the value of the field IS stored in the database, it will need to be updated whenever one of the referring nodes changes its reference. After all, when a referring node stops referring to our node with the nodereferrer field, we want this change to be reflected in the View. If at one point, nodes A, B and C refer to node X, we want the view to show A, B and C; but if node B is changed to no longer refer to node X, then we want the view to show A and C.

So this means that some 'event handler' needs to exist that changes the content of the nodereferrer field when the reference in one of the referring nodes changes.

This code that changes the content of that nodereferrer field is, I assume, the code in the function where the patch adds the one line (see above).

So this code needs to be invoked when a nodereference field changes. That means that a patch for nodereference is required I guess, which makes nodereference dependent upon nodereferrer. Actually, maybe the two should be merged into one module?

I wish I could actually program these things . . . :-/

Alice Heaton’s picture

@Worldfallz, @matherion : Following patch fixes the problem reported in #23 (and in the first paragraph on #24)

I'd already fixed that in my own version, forgot to post it here sorry. The patch is in function nodereferrer_field.

Index: nodereferrer.module
===================================================================
--- nodereferrer.module (revision 1373)
+++ nodereferrer.module (revision 1374)
@@ -118,6 +118,10 @@
         $items[] = $rnode;
       }

+      if (count($items) == 0) {
+        return array($field['field_name'] => array());
+      }
+
       $output = array(
         'items' => $items,
         'limit' => empty($field['referrer_nodes_per_page']) ? 0 : $field['referrer_nodes_per_page'],

I'm going to be really busy for the next few days, so I won't have time to look at the Views issue before Tuesday at best ; maybe someone else around here has the skills to look at that ?

@Miraploy : If no-one else does it, I'll post an updated module once the Views issue is fixed.

matherion’s picture

FileSize
3.72 KB

I've patched the module file with this patch as well, and here's the new version. I'm sorry I can't help with the views thing . . .

@Miraploy: just place this file in your nodereferrer directory in the modules directory, then disable the module, and enable it again!

(If you don't manage to extract it, you can download 7-zip at http://www.7-zip.org/; it's an open source compression program that handles the GZip (.gz) en Tar (.tar) formats)

(actually, I only use those because everybody else here does, so that I can look cool too; normally I use the 7-zip format nowadays :-))

WorldFallz’s picture

i can confirm the patch in #28 fixes the problem in #23. Now it seems just the views issue is left. i'm no views guru, but i'll be able to take a look this weekend-- maybe i can spot something obvious.

mrfelton’s picture

subscribing, thanks

netbear’s picture

subscribe

4drian’s picture

Excellent work - subscribing (is there a better way to subscribe?)

Junro’s picture

subscribe :)

yark’s picture

subscribe how does it works? :)

Alice Heaton’s picture

Right, I see what is happening in #24... The problem is not with the views filters (which is the bit I had implemented) but when displaying the nodereferrer as a field (which I hadn't even tested ! do !).

The problem is that CCK wants to query a value for the field from the content type table ; but nodereferrer doesn't have a value, it's a read-only property (it gets its values from the counterpart nodereferences fields).

We need to see if we can either write a our own handler for this type of field (that would overide the CCK generic handler), of if we can tell CCK not to query any field (or maybe always query 'nid' or something).

Alice Heaton’s picture

FileSize
12.25 KB

Right, I gave up trying to tell CCK that really, nodereferrer doesn't need a database column, and so wrote the field handler from scratch (similar to the views handlers). This should fix #24 ;

Note that you should use group 'Node', and select the field 'Node: Nodereferrer: by node field' or 'Node: Nodereferrer: by node type' (NOT the one in 'Content : Nodereferrer' which won't appear for new fields anymore)

You get the same options as for the filters (select which refering field/types to use ; multilingual options) plus you select which of the formatters to use for display (default, plain, teaser, body).

Please have a go and let me know if there' s any problems !

dydecker’s picture

nodereferrer-6.x-dev.tgz is working well, but I'm getting the following error on first viewing/creation/updating of nodes (doesn't seem to effect module behaviour any though).

warning: Invalid argument supplied for foreach() in sites\all\modules\nodereferrer\nodereferrer.module on line 40.

EDIT: fixed on reinstall of CCK 6.x-2.x-dev

yark’s picture

This happens if you not correctly set up node types for referrrer field. Just go to your content type with nodereferrer field enabled and set checkboxes for at least one type of content and nodereferrer field for it.

mrfelton’s picture

I have a Parent -> Child -> Grandchild relationship. I want to say "Show me all parents that have a particular grandchild". I've been exploring the various options available to me for a few days now and am pretty sure that node_reference and nodereferrer should be able to do what I want...

Node Reference makes it's fields available in the Relationships section of views, allowing me to say "Show me all grandchildren that have a particular parent" (the reverse of what I want!) by adding the relationships in my view, making them 'required', and then adding a filter that filters on a field from the Parent. Effectively filtering the Grandchildren based on weather or not they have a particular parent.

I need to go the other way round ("Show me all parents that have a particular grandchild") but I can find how to do this with nodereferrer. Unlike Node Reference, Nodereferrer doesn't seem to add it's fields to the Views Relationships bit. Meaning that I cant filter my Parents based on weather or not the have a particular Grandchild. Or perhaps there is another way?

I'm sorry if this is the wrong place for this question, but this seems to be the only place where D6 functionality of this module is being discussed.

Thanks, Tom

ps. nodereferrer-6.x-dev_1.tgz is working nicely for me so far, thanks!

Alice Heaton’s picture

@mrfelton : You are right, nodereferrer doesn't add a Relationship to Views. I'm going to be pretty busy for the coming month, so won't have time to do this myself for a while ; maybe someone else around can do this ?

And yes, this is the only place to talk about D6 stuff, until Dopry creates a D6 branch of the module (Dopry ? DOPRY ? Would be nice to hear from you....)

matherion’s picture

It works!!!

Anselm, you are a genious!!! Thank you!!!

Also to Dopry and all who have contributed to make this possible of course!!!

This is, at least for the kind of website I'm making now, exactly what I need!!!

So, thank you! :-)

Squirrelly’s picture

This is great, thanks! Both Dopri and Anselm Heaton!

I was trying to set up a new site and using CCK node reference, and trying to figure out how the heck to do exactly what this does.

It's working great, other than I do get an error when I add a new Node Referrer field. E.g.:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') SELECT vid, nid, 0, FROM content_type_show' at line 1 query: INSERT INTO content_field_episodes_ref (vid, nid, delta, ) SELECT vid, nid, 0, FROM content_type_show in /usr/local/drupal/drupal-6.5/sites/all/modules/cck/includes/content.admin.inc on line 1469.

Donno but might be the trailing comma in there causing it.

I get this error after the final submission of the second page.

However, after getting the error, if I manage the fields for that content type it shows the Node Referrer just fine. And if I go look at the site content, the nodes of that content type are showing all the referrers just fine, and continue doing so when I add new ones.

I have not recv'd any other errors after that, as far as adding or editing content. Of course adding a new Node Referrer generates another identical error, other than field names.

As far as what I have installed, I started with a fresh D6.4, then the next day (of course) 6.5 came out, so I updated to that. Then I installed the latest CCK and the module from # 37 here (I had never tried any of the earlier versions, so donno if that makes a difference). I checked that Updates.php didn't have any updates it wanted me to do either. I have not installed anything else.

Alice Heaton’s picture

@squirelly : I haven't tested the latest CCK release - maybe there's an issue there, I'll take a look whenever I get a second !

Babalu’s picture

subscribe

Squirrelly’s picture

Cool, thanks! Just for specifics, the CCK I'm using is 6.x-2.0-rc10.

Squirrelly’s picture

Oops, another bug. I just tried installing views-6.x-2.0-rc5 and now when I go to the Site Building -> Views I get that same warning: Invalid argument supplied for foreach() in /usr/local/drupal/drupal-6.5/sites/all/modules/nodereferrer/nodereferrer.module on line 40. that dydecker was getting in msg #38 here.

I'll try reinstalling as he did and see if can figure anything else out too, but probably will be later tonight when I get the time.

Alice Heaton’s picture

Hi, this patch (against the module version in #37) fixes the error reported in #39 and #47. Don't worry if you did have the bug before - it wouldn't have affected module behaviour.

Index: nodereferrer.module
===================================================================
--- nodereferrer.module (revision 1388)
+++ nodereferrer.module (working copy)
@@ -37,8 +37,12 @@
   switch ($op) {
     case 'views data':
       $data = content_views_field_views_data($field);
-      foreach ($data as $k => $v) {
-        $data[$k] = array();
+      if (is_array($data)) {
+        foreach ($data as $k => $v) {
+          $data[$k] = array();
+        }
+      } else {
+        $data = array();
       }
       return $data;

The point of this code is simply to stop CCK creating it's own default handlers for the view fields/etc. There doesn't seem to an API to do this anywhere.

toddwoof’s picture

Neat module. Working fine in D 6.5. Two quick questions:

1 - The "Node Body" field display settings seems to show the whole node -- all the fields for each node with a node reference to this node -- not just the body field of the referring nodes. Is that the expected result?

Is there any way to pick and choose which fields are shown? Say, Title and some other CCK field?

2 - If there aren't any nodes that have node references to this node, I still see the field label. Is there some way to show the field label only if there are actually results there?

Example: I have a Node Referrers field named "related pages" -- but for some node, there aren't any related pages to show. I still see "Related Pages:" on the page, with nothing under it.

Thanks!

Squirrelly’s picture

@Anselm: Fantastic, thanks! I've been testing this out the last day or so, and looking good! The error I originally got in Views actually turned out to be a one time thing. I just closed by browser and reopened it, and didn't get the error again when I went to Views. With this new patch it has stopped the error I was getting when adding a new Node Referrer, and no errors in Views so far either.

If some others trying this out want to give some feedback too, I might think this is ready for at least a -dev release (and that only due to that both CCK 2 and Views 2 still aren't final releases yet).

@toddwoof: I haven't used the node body reference, so can't address your issue #1, but as for #2, for Node Referrers where no nodes reference that node, I am not seeing any header displayed for it in either the preview or full node views, for me. I'm using D6.5, CCK 6.x-2.0-rc10, Views 6.x-2.0-rc5, and the module here from msg # 37 plus the patch from msg # 48, if that helps.

If you want me to walk through what I'm setting when adding a Node Referrer just let me know.

Alice Heaton’s picture

@toddwoof :

1. Well, the proper way to do that would be to add a Relationship in the View, so that then you could display which fields to display. Unfortunately, there isn't a Relationship handler for Noreferrer yet. This was already requested in #40, and if no-one else does it, I'll do it when I get some time ; don't hold your breath.

In the mean time you could do this by themeing it. You can implement your own theme for 'nodereferrer_field_full' (for the 'full' node display) and could get that to display what you like (This would required a bit of coding and drupal knowlege though)

2. Which version are you using ? This issue was reported before, and I thought it had been fixed... If you are not using the latest version (which is the one in comment #39) please try that one.

toddwoof’s picture

Probably I'm not explaining the issue properly:

I have added a Node Referrers field to the "book page" type, with the label "Related Resources."
And I have a content type "resources" with a node reference field set to allow references to book pages.

When viewing a book page that has nodereferences to it I see "Related Resources" and a list of the references -- as expected. But on a book page with no node references to it I see "Related Resources" and nothing under it.

The page source code shows the label, then divs for "field-items", "field-item odd" and "item-list" -- but no content, since there isn't any.

Using the same versions. Haven't applied the patch, since I didn't have the problem it addresses. (Should I apply the patch anyway?)

Thanks!

Squirrelly’s picture

@toddwoof: Yeah that's what I thought you meant. I don't know if it makes a difference for existing content types, but I have in mine a custom 'show' content type and an 'episode' one.

In the episode node it has a CCK node reference to a 'show' type node, to indicate what show it belongs to. And in the show node it has a node referrer pointing back to episodes with references to it.

For shows which have episodes it gives the "Episodes" title and lists the referring episodes. For shows with no episodes provided, it doesn't display it, header or content, for me. I even checked the source, in case it's a CSS or browser issue, but there's no sign of 'episodes' at all in the node.

Maybe also check your database for some bad data in it that's actually pointing to it?

toddwoof’s picture

Anselm and Squirrelly:
On #1, I was thinking of adding a piece of code identical to the current "Node Body" display choice, but with the title not as a hyperlink. (Well, asking someone who knows how to do that...) Then I can use CSS to hide the other fields I don't want. But if people have already mentioned it, maybe I'll sit on my hands and wait for a proper solution.

On #2: Doh! I did have the wrong one. The latest version works correctly.

Thanks for your help!

kenorb’s picture

Alice Heaton’s picture

@kenorb : The version in comment #39 has more features and some bug fixes, use that one instead !

kenorb’s picture

Thanks, because there is too much patches, and you never know which to use;) I'll use #37

Squirrelly’s picture

Yep, the one from #37! And don't forget the patch in #48 which you apply to the module in #37, to get rid of a couple of errors that will pop up otherwise (if you're using the newest view and cck).

Squirrelly’s picture

Well another Views is out, Views 6.x-2.1, and looks like it's finally out of beta/rc status.

And as I figured, a new Views causing new errors. Well not quite new. The old error is back, when adding a new Node Referrer to a Content Type:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') SELECT vid, nid, 0, FROM content_type_show' at line 1 query: INSERT INTO content_field_images_ref (vid, nid, delta, ) SELECT vid, nid, 0, FROM content_type_show in /usr/local/drupal/drupal-6.5/sites/all/modules/cck/includes/content.admin.inc on line 1469.

But good news is, other than that, so far the patch from here is still working great. I don't even get an error going into Views or adding a new Node Referrer entry in a View.

If I run into anything else while playing with it over the next few days I'll let ya's know.

FiNeX’s picture

On the nodereferrer page, the 6.x-dev file is not listed. Is it safe to use the latest one uploaded on comment #37?

Flying Drupalist’s picture

Yes it is.

rmassamiri’s picture

I apologize for this question... The patch in #48 for the module in #37, where do I actually copy and paste that? Thanks.

rmassamiri’s picture

I believe I figured it out. Where there is a minus at the beginning of the line, then go look for that line in the module and delete the line. Where there is a plus, replace the lines you deleted with the the lines which have a plus. I hope this helps other newbies.

kirkcaraway’s picture

subscribe

wrb123’s picture

how can i apply this patch, please? i have already installed the module 2008-JUN-10 for D6 and am getting line 40 errors.
should i just put that code in a file and place it somewhere? should i find code that looks like that in my module and replace certain code with those lines? please help :)
-bill

wrb123’s picture

#40 solution for grandchild -> child -> parent?

assuming this hierarchy:
parent
child
grandchild

if child has a nodereference field called field_child_to_parent
and grandchild has a nodereference field called field_grandchild_to_child

couldnt you create a new nodereference field called field_grandchild_to_parent and choose autocomplete text box,
then under Default Value, PHP Code, do this:

$first_node = node_load(node->field_grandchild_to_child[0]['nid']);
$final_node = node_load($first_node->field_child_to_parent[0]['nid']);
return array(
0 => array('nid' => $final_node)
);

?

that is currently giving me error "The default value PHP code returned an incorrect value. Expected format:
return array(
0 => array('nid' => value for nid),
// you'll usually want to stop here unless you want your default value to be multi-valued
1 => array('nid' => value for nid),
2 => ...
);

i am not very good at PHP, so perhaps someone who knows php, nodereferrer, nodereference, and drupal could help me and others figure this out? it would be a good way to get a field to bridge the generation gap by tracing the family tree :)

mrfelton’s picture

#wbr123, thank you very much for this interesting solution. It definitely sounds like it might do the job. I'll have a go at implementing it a little later.

WorldFallz’s picture

wrb123’s picture

mrfelton: please let me know if you get the php figured out, as I would love to get this working for my new site! :)

WorldFallz: thank you for the patch/apply link, I appreciate it.

rmassamiri’s picture

Not sure why, but I'm getting this error now...

warning: Invalid argument supplied for foreach() in /nfs/c03/h03/mnt/53302/domains/mysite.com/html/sites/all/modules/nodereferrer/nodereferrer.module on line 251.
warning: Invalid argument supplied for foreach() in /nfs/c03/h03/mnt/53302/domains/mysite.com/html/sites/all/modules/nodereferrer/nodereferrer.module on line 251.

Any thoughts?

mrfelton’s picture

@wrb123

I haven't actually had a chance to try this myself, but wouldn't it be:

$first_node = node_load(node->field_grandchild_to_child[0]['nid']);
$final_node = node_load($first_node->field_child_to_parent[0]['nid']);
return array(
  0 => array('nid' => $final_node->nid)
);

Since it's expecting a node id, not an actual node (which is what you would get from node_load).

brynp’s picture

subscribe

wrb123’s picture

solution to #40, 66, 67, 69, 71 issue using Computed Field module:

Hierarchy:
TypeA
-TypeB (has nodereference field typeb_to_typea) this field shows the name of node a
--TypeC (has nodereference field typec_to_typeb) this field shows the name of node b

install Computed Field module, make a computed field in content type typeC, and put this in it:

$mytempvar=db_result(db_query("SELECT
field_typeb_to_typea_nid FROM content_type_typeb WHERE
nid=%d",$node->field_typec_to_typeb[0][nid]));

$node_field[0]['value']=db_result(db_query("SELECT title FROM node WHERE nid=%d", $mytempvar));

(returns node Title) Note: look at Hierarchy above and depending on what fields you use in your content types and what their names are, you will have to change
field_typeb_to_typea_nid
to
field_your_field_name_nid (attach the _nid to whatever the name of your field is, your field should start with field_ no matter what)
also
content_type_typeb
to
content_type_yourtype (content_type_ + whatever your type is)
also
field_typec_to_typeb
to
field_your_field_name (your field should start with field_ )

if you want to return the node Number/ID instead, do this (same field name rules apply to this as the code above):

$node_field[0]['value'] = db_result(db_query("SELECT
field_typeb_to_typea_nid FROM content_type_typeb WHERE
nid=%d",$node->field_typec_to_typeb[0][nid]));

(returns node ID #)

maybe this works in the PHP section of a nodereference field for default value? I'm not sure - but it works if you use Computed Field !

-Bill :)

P.S. i used a varchar as the computed field field type and also chose 64 as size (you may need to use a different size and im not sure if something other than varchar will work - this is a computed field issue though.)

nickvu2’s picture

subscribe!

.jon’s picture

Thanks for working on this!

I think I have some version conflict, as I can't get this to work 100%. I get this error when creating a Node Referrer field in a new content type:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') SELECT vid, nid, 0, FROM content_type_content1' at line 1 query: INSERT INTO content_field_content2 (vid, nid, delta, ) SELECT vid, nid, 0, FROM content_type_content1 in /home/customers/project/public_html/sites/all/modules/cck/includes/content.admin.inc on line 1503.

Drupal 6.6
CCK 6.x-2.0
Node Referrer 6.x-1.x-dev #37, patched with #48

also have installed
Views 6.x-2.1, (but not using it to to view the results at the moment. )
Internationalization 6.x-1.0-beta4 (don't know if this could influence)

Like Squirrelly in #59, I can get the field to work OK, but this error came up when creating a node of type "content1"

user warning: Duplicate entry '30-0' for key 1 query: INSERT INTO content_field_content2 (vid, nid, delta) VALUES (30, 30, 0) in /home/customers/project/public_html/sites/all/modules/cck/content.module on line 1198.

I'm trying to get nodes of type "content1" to have an unlimited number of references to nodes of type "content2", and so far all good, except those errors. Should I be worried?

cheers.jon

japanitrat’s picture

subscribe

heydere’s picture

subscribe

higherform’s picture

Status: Needs work » Needs review

Using Anselm's 6.x patch in #37 plus #48 , upon creation of a Nodereferrer field in CCK, I got the following SQL error, which appears to be the same error as .jon in #75:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') SELECT vid, nid, 0, FROM content_type_stormtask' at line 1 query: INSERT INTO content_field_referrers (vid, nid, delta, ) SELECT vid, nid, 0, FROM content_type_stormtask in /var/www/html/drupal-6.6/sites/all/modules/cck/includes/content.admin.inc on line 1506.

Notice the extra comma after delta in the insert fields list.

Removal of the comma then a manual run of the SQL statement in phpmyadmin was successful.

Will continue testing and hope we can get a stable release for 6.x going soon.

chrisroditis’s picture

Everything is working fine here, with the version at #37 and the patch at #48!
Anselm, if there is any way I could help getting views relationships done , please let me know! By searching around, I see it's a rather complex issue!

Alice Heaton’s picture

@christopher_skauss : Yes, it's a complex issue, otherwise I would have done it :)

@everyone : I know there's a couple of bugs to fix, but it's getting really difficult to work on this thread - a single thread to manage a whole module and multiple bug reports is pretty difficult ! I'm waiting for Dopry (the module maintainer) to commit this to CVS (or to say why s/he doesn't want it committed) before I do any more work on this.

@Dopry : If you read this, please commit the version in #37 ; or if you don't want this to happen then please let us know why ! As you can see a few people are now depending on this module !

andypost’s picture

FileSize
18.46 KB

I got same error (#75 duplicate) but everything works - it looks like record tries to store twice.
Error appears only if create parent node

Version from #37 with patch #48

dopry’s picture

Status: Needs review » Needs work

The module in #37 looks mostly good. Initial review there are a few iis_array calls that should be !empty && is_array. It would be much easier for me to review it further if it were posted as a patch instead of a tar.Is the translation support a new feature? Can we roll that as a seperate issue and patch? I'll try to test further when I am at a computer instead of my phone.

andypost’s picture

FileSize
23.41 KB

Patch against cvs but views additions not included (take from .zip)

kenorb’s picture

I've the same problem as in #75 with 'Duplicate entry '8-0' for key 1.
This error is because content.module (in CCK) trying to write two the same records in folowing function (look for content_write_record()):

function content_storage($op, $node) {
...
        // $record might be empty because
        // - the table stores a multiple field :
        //   we do nothing, this is handled later on
        // - this is the per-type table and no field is actually stored in it :
        //   we still store the nid and vid
        if (count($record) || empty($schema['content fields'])) {
          $record['nid'] = $node->nid;
          $record['vid'] = $node->vid;
          // Can't rely on the insert/update op of the node to decide if this
          // is an insert or an update, a node or revision may have existed
          // before any fields were created, so there may not be an entry here.

          if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE vid = %d", $node->vid))) {
            content_write_record($table, $record, array('vid'));
          }
          else {
            content_write_record($table, $record); // <!-- HERE !!!
          }
        }
      }

      // Handle multiple fields.
      foreach ($type['fields'] as $field) {
        if ($field['multiple'] && isset($node->$field['field_name'])) {
          $db_info = content_database_info($field);
          // Delete and insert, rather than update, in case a value was added.
          if ($op == 'update') {
            db_query('DELETE FROM {'. $db_info['table'] .'} WHERE vid = %d', $node->vid);
          }
          foreach ($node->$field['field_name'] as $delta => $item) {
            $record = array();
            foreach ($db_info['columns'] as $column => $attributes) {
              $record[$attributes['column']] = $item[$column];
            }
            $record['nid'] = $node->nid;
            $record['vid'] = $node->vid;
            $record['delta'] = $delta;
            content_write_record($db_info['table'], $record); // <!-- AND HERE !!!

I'm not very familiar how to write field modules for cck,
but noderefferer probably should increase delta for the next record, but the problem is that this record is empty when creating it, so content_write_record() shouldn't be called twice.

andypost’s picture

Suppose this bug #84 caused by another - when saving field settings after changing "Number of values" from 1 to any
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') SELECT vid, nid, 0, FROM content_type_parent' at line 1 query: INSERT INTO content_field_childs (vid, nid, delta, ) SELECT vid, nid, 0, FROM content_type_parent in sites\all\modules\cck\includes\content.admin.inc on line 1506.

Maybe wrong implementation of multiple values?

drewish’s picture

andypost, I haven't looked into this patch but the values for a fields multivalue setting changed between D5 and D6 so it'd be work checking that the patch was updated for that aspect.

Flying Drupalist’s picture

Getting this error:
* user warning: Duplicate entry '235-0' for key 1 query: INSERT INTO content_field_reviews (vid, nid, delta) VALUES (235, 178, 0) in /home/webadmin/html/sites/all/modules/cck/content.module on line 1199.
* warning: Invalid argument supplied for foreach() in /home/webadmin/html/sites/all/modules/nodereferrer/nodereferrer.module on line 251.

Please help.

higherform’s picture

Status: Needs review » Needs work

Getting the same errors as #87.

Errors appear:

  • when adding a node of a content type that is allowed to be a parent
  • when editing any node of a content type that is allowed to be a parent
  • (will update this list if I can find any more cases where the errors appear)

    Using Drupal 6.6, cck-6.x-2.1, and nodereferrer 5.x plus patches #37 and #48 in this thread

    see also : http://drupal.org/node/341837

    @dopry -
    at this point, I really think the 6.x branch should be offered as an alpha or dev release, for no other reason than to isolate issues dealing with that branch from the 5.x branch correctly, instead of in one big thread or having issues incorrectly marked as dealing with 5.x

    Jax’s picture

    subscribing

    neurer’s picture

    Posting this to subscribe. Getting warning: Invalid argument supplied for foreach() in /.../nodereferrer/nodereferrer.module on line 251 as well when adding nodes.

    Jax’s picture

    You might want to check out http://drupal.org/project/viewfield which might be a lot more appropriate for a lot of use cases. Since it takes view arguments it also integrates nicely with nodes that use the "node reference" field.

    chrisroditis’s picture

    The fact that it will be able to do Views Relationships (in the future) is what sets this module apart, I believe.

    andypost’s picture

    viewfiled has a lot of open issues too
    So I don't which way is preferable ...
    node-referer works well but error message in parent creation makes it unusable in production env

    wrb123’s picture

    Re: #93 - unusable in a production environment? If this error causes a serious problem then ok, but I was worried about it too until I decided to write errors to log only instead of to log and screen (can't remember where the setting is exactly).

    wrb123’s picture

    kenorb’s picture

    BTW. Maybe somebody knows some module which will disable error messages for specified role or by some rule?

    Jax’s picture

    If you change the first 2 lines of nodereferrer_theme_formatter() to:

    function nodereferrer_theme_formatter($formatter, $info) {
      // Function is called on node creation but there are no items at that time.
      $items = $info['#item']['items'] ? $info['#item']['items'] : array();
    

    you clear the foreach error. I'm not finding the INSERT issue though.

    Jax’s picture

    If you set the "Number of values:" for the field to 1 in stead of "Unlimited" everything keeps working and the INSERT error disappears.

    Jaza’s picture

    Subscribing. Using the code from #81, with the fixes in #97 and #98 (to get rid of the PHP warnings), and this module is working great for me. The code in this thread should be committed to HEAD, in my opinion - time for a D6 alpha release of nodereferrer.

    andypost’s picture

    maybe someone produce a final patch against current cvs ?

    about #97
    suppose better

    function nodereferrer_theme_formatter($formatter, $info) {
      // Function is called on node creation but there are no items at that time.
      $items = isset($info['#item']['items']) ? $info['#item']['items'] : array();
    
    kenorb’s picture

    Patch for warning issue with 'Duplicate entry' you can find here: http://drupal.org/node/347712
    Probably it's a bug in cck.
    Please test it.

    Alice Heaton’s picture

    maybe someone produce a final patch against current cvs ?

    If no one else has done it before then, I'll do this early January. One of the issues is that I've added some extra features in there, that need to be removed as dopry wants to consider them separately.

    cruiz’s picture

    Hi,
    after having installed the patch in http://drupal.org/node/347712, it seems to be working properly.
    Thanks a lot!

    chrisroditis’s picture

    Thanks Anselm, nice to know this on your todo list!

    bullz’s picture

    It is possible to create a view with this functionality without using any extra modules.

    just follow this steps:

    • Add "Relationships" with the "Node reference"
    • Add argument node:node ID
    • Use relationship
    • Provide default argument
    • Default argument type: node ID from URL

    Now you can create a block, a page etc with this refered content

    heacu’s picture

    subscribing. good point in 105.

    chrisroditis’s picture

    Relationships really are the most important thing to hit views 2.
    Node reference is what makes them show their full potential. Good point bullz

    Flying Drupalist’s picture

    Title: Drupal 6 » Nodereferrer Drupal 6
    gallamine’s picture

    subscribe

    andypost’s picture

    Title: Nodereferrer Drupal 6 » Nodereferrer Drupal 6 patches + zip
    Component: Miscellaneous » Code
    Status: Needs work » Needs review

    This version works for me, consisits of latest patches from this queue
    But cck should be patched if multiple fields: #347712: when inserting multiple field, there is mysql syntax error: Duplicate entry '1-0' for key 1

    andypost’s picture

    FileSize
    18.47 KB

    Ups... file was not attached

    no2e’s picture

    Will there be a "real" Drupal 6 release? (and if yes, when roughly?)

    If I get it right, I need the features NodeReferrer offers, but to be honest: it doesn't feel right to use a patch for getting it to work.

    chrisroditis’s picture

    Can we please get a drupal 6 release?

    wrb123’s picture

    I've been using this module for two months without an issue; I think a dev version would be okay :)

    no2e’s picture

    that would be fantastic.

    jacks0_0’s picture

    can someone tell me how to make a referrers with relationship (I can only make reference with relationship) . For example:
    I made 2 content type: one is singer (referrer), and one is album(reference).

    It can display the singer's image when browsing album, but I don't know how to display album's image (and other information) when browsing singer. Anyone knows how to do it?

    Anonymous’s picture

    Zip files in #111 works for me. Let's get an official release out.

    txcrew

    chrisroditis’s picture

    jacks0_0:
    You cannot do it yet. Node Referrer does not support Views Relationships right now.

    Anselm Heaton at #51 said:
    Well, the proper way to do that would be to add a Relationship in the View, so that then you could display which fields to display. Unfortunately, there isn't a Relationship handler for Noreferrer yet. This was already requested in #40, and if no-one else does it, I'll do it when I get some time ; don't hold your breath.

    At this point, a relationship handler is the missing piece of the puzzle for many people around. Maybe if we could fund Anselm to do it? I am willing to offer the first $100.
    And of course we need a proper 6.0 release from Dopry.

    wrb123’s picture

    can't you do this in Views2 by adding:

    Argument of Node: Nodereferrer: By Node Type (choose default Argument, choose From URL, choose checkbox for Album)
    Field of Node: Title (or maybe in your case, field of album_cover or whatever it's called
    Filter of Node: Type (check box for Album)

    ?

    chrisroditis’s picture

    yes, my wrong you can do that on a per node basis. But what about getting a list of all artists and their respective albums(and/or album covers)? You need a reverse node reference relationship for that.

    jacks0_0’s picture

    yes, reverse node reference relationship (node referrer relationship) is very important! Without it, nodereferrer is not perfect. Can someone add this feature?

    Flying Drupalist’s picture

    @christopher, what wrb123 said works too in that case. Did you try it?

    Edit: though I agree a relationship would simplify matters, and since everything has relationships nowadays this is necessary too.

    toddwoof’s picture

    Maybe I'm thinking of a scenario that isn't similar enough -- but can't you just add a nodereferrer field to the list of fields to display?

    For example, I have a content type "sailors" and contact type "boats." Sailors has a nodereference field, "sails_on_these_boats." When I enter a new contact, I can use the nodereference field to pick which boats this sailor sails on. I can then create a view, filter by content type = boats, and select two fields to display: Node title (the name of the boat) and Nodereferrer-by-node type, with "Sailors" selected as the type.

    That outputs a list of boats, and who sails on each boat.

    But, there is a limited number of choices of what nodereferrer node data I can display. Maybe this is what you mean. I can show title, teaser, or body. I can't, say, pick some image field and just show that.

    chrisroditis’s picture

    Miraploy: I gotta try that to stop my whinning...but there are other essential use cases for relationships, such as chaining relationships, or the issue toddwoof brought up(pick an image field or other fields). Anyways, my offer to fund the development of referrer views relationships is still on, first $100 is paid by me.

    jacks0_0’s picture

    I agree with you all, I really need referrer relationship, too :) I think anyone who has ever used drupal also need this feature :) please develop it :) Also, can anyone show me how to display an empty text if using referrer? :) thanks

    WorldFallz’s picture

    Pleas for 'someone' to develop something usually don't get very much accomplished. This post is has 125 comments on it and so far only christopher_skauss is willing to actually do something about it. I would think that if everyone posting a need for this module contributed, a developer could be found to work on it.

    wrb123’s picture

    I definitely see where people are coming from who haven't volunteered their time or money in support of this feature, because your mention of 125 posts without more monetary contributors is canceled out by the fact that there are 125 posts and no dev release of this module, even though it's been working fine for people for a couple months. I wouldn't want to contribute money to a feature that a lot of people wouldn't take advantage of because they're afraid to use a module that isn't listed on the project's main page, and I definitely appreciate everyones hard work (original developer(s) of D5 version and people who made this D6 version come together). I agree that people, if they want something badly enough, should put their money where their mouth is, but at this point I'd rather contribute toward an official release...

    chrisroditis’s picture

    Ok, I might be putting my money where my mouth is (I might be a billionaire...but this is truly my last resort, usually), but before that, I personally contacted Dopry to bring his attention to this issue, and after that he did respond at #82 on Nov 23. After that there is no sign of Dopry, I believe he is truly busy with other issues. So I don't know how we -the community- can deal with the issuing of a 6.x release. What is standard practice for such occasions? Do we need a co-maintainer with cvs access? A second fund-raiser maybe ;)

    Until that is resolved please allow me to focus on a feature request that should normally have it's own issue, and is needed by more people than just me. Still on for $100, anyone care to join drop me a line and we can hopefully close this issue and make it a part of the first 6.x release when that happens.

    wrb123’s picture

    Good point! I hardly think it would take more than 10 minutes to take a module people are developing and already have in module form, stamp it with a date and upload it to the projecþ page :) oh well

    thePanz’s picture

    @Christopher: you're right, I'm opening an issue about co-maintaining this module. Post your reply on #358664: Is Nodereferrer still maintained?.
    I'm following what pointed on http://drupal.org/node/251466 on Drupal best practices. Hope you'll get in soon! :)

    Regards

    chrisroditis’s picture

    that's the correct thing to do, thanks for taking the initiative.

    nquocbao’s picture

    Hi,

    I'm new to this issue, but due to my requirements so I decide to work with relationship problem.

    Here is the first version of my patch, it's still confusing but it works. Please check on your side and give comments.

    Thanks

    p/s: about 100$ ? :P

    nquocbao’s picture

    I tried to used cck based relationship class handler. But seem like it doesn't work, maybe any others can suggest ideas ?

    chrisroditis’s picture

    nquocbao let me give it a try and see if it works, I am really excited to see someone working on this! of course I will remain true to my word.

    jacks0_0’s picture

    I tested it and it worked perfect! thank you so much, nquocbao ^ ^ thanks christopher for the supporting fund :) you're the man!

    TwoD’s picture

    Tested the code in #132

    Line 36 in views/nodereferrer_view_handler_relationship_referers.inc is

          file_put_contents('D:\test.txt',print_r($this->query,true));
    

    Found it when it gave me a curious permissions error hehe.

    Other than that, I think I can confirm that the relationship code is working.

    nquocbao’s picture

    Opps, It's my debug code. Thanks for "detected" it out.

    I will update the code tonight with some improvement :)

    nquocbao’s picture

    Status: Needs review » Reviewed & tested by the community
    FileSize
    19.42 KB

    Here is the updated version. I removed the debug code and add "empty text" feature requested by jacks.

    I'm trying to eliminate the duplication in relationship when you join many to many. I will update here when I finish.

    dopry’s picture

    well a patch instead of a zipped module is a good place to begin getting me to commit it to HEAD. I branched DRUPAL-5 today so I could officially start work on 6.x.

    dopry’s picture

    Status: Reviewed & tested by the community » Fixed

    I've commit the patch from #83. Please post any additional updates following that as new patches in their own issues so I can review them more easily.

    andypost’s picture

    Status: Fixed » Needs review
    FileSize
    8.52 KB
    3.14 KB

    Here the first patch (last changes from #138 - most of fixes)
    and zip with views folder (I dont know how to add new folder with files to patch

    detot’s picture

    Version: 6.x-1.x-dev » 5.x-1.x-dev
    detot’s picture

    Version: 5.x-1.x-dev » 6.x-1.x-dev

    andypost does that patch goes on the #138 files or http://drupal.org/node/360732

    Flying Drupalist’s picture

    He says in his post #138?

    Looks like the official releases are not caught up yet.

    dopry’s picture

    Status: Needs review » Reviewed & tested by the community

    #141 changes look good, updating status so I'll remember to commit.

    @andypost: why not always return the referrer_translations in the settings array?

    andypost’s picture

    Version: 5.x-1.x-dev » 6.x-1.x-dev

    @dopry: Because "Content translation" module is not always enabled and possible cause warnings and errors.

    Cck uses translations look at hook_field() so if someone use this feature of D6 please check it works right!

    Suppose only refferers with same lang should be visible

    momper’s picture

    sub

    watbe’s picture

    subscribing...

    surgeonbor’s picture

    subscribing

    iaminawe’s picture

    subscribe

    nquocbao’s picture

    Any problems since ?

    wrb123’s picture

    this module continues to work fine for me, although if youre talking about the Views support, I dont use it so i cant comment

    TwoD’s picture

    Works fine for me too, including the Views support.

    chrisroditis’s picture

    nquocbao> It's all great so far, views relationships work as expected! It would be really great if you shared any updates you might have though!

    Have not stumbled upon anything worrisome yet, except for the error mentioned at #75 and #87:

    user warning: Duplicate entry '13-0' for key 1 query: INSERT INTO content_field_blablabla (vid, nid, delta) VALUES (13, 13, 0) in sitename\sites\all\modules\cck\content.module on line 1200.

    Has everybody bypassed it by patching CCK as suggested in http://drupal.org/node/347712 ? I think we need to nail this bug down over here if possible and leave CCK as is.

    nquocbao’s picture

    Seem like the bug is caused by CCK, so we will have to wait for CCK team.

    Currently, I don't have any plan for update, just wait for bugs. But I want to improve the relationship performance, to make it look like noderefererence. It's just a mirror update anyway.

    I hope we can release a stable module soon.

    Tenx-1’s picture

    Suscribing , really need this for my site

    zdean’s picture

    Is it possible to get an updated version zip file with the #141 patch while we wait for the stable release? It would help us newbies who don't know how to work with the patches :-)

    Thanks for everyone's work!

    WorldFallz’s picture

    Don't take this the wrong way, but if you plan on using drupal for any length of time and wander around the issues queues, its something you'll have to learn sooner or later: http://drupal.org/patch/apply

    Besides the fact it's a total waste of space to repost entire modules over and over again, you won't engender much good will when you post requests for full modules because you don't know how to patch (to put it mildly, lol).

    zdean’s picture

    no offense taken. it was simply a courteous request...As I said, I'm really new to the world of drupal/web development, so if something is not kosher, I'm sure it will be pointed out to me :-) It's how we all learn!

    ...not to mention that the zip files appeared throughout this thread.

    paulludington’s picture

    Subscribe.

    koala098’s picture

    I am now definitely confused. Is this thread up to date? I am using nodereferrer_relationship_2.zip, but nothing happens. I am drupal beginner. Have I to install anything new or is it enough to overwrite the nodereferrer-folder.
    In modules now I have:
    Node Reference 6.x-2.1
    Node Referrer 6.x-1.x-dev
    Nodereferrer Create 6.x-1.x-dev.
    Can anybody make a screenshot how the nodes should looks like with nodereferrer_relationship_2.zip?

    wrb123’s picture

    under Arguments, i now have "Error: handler for node > nodereferrer_type doesn't exist!" - this ruins my site considering it depends on nodereferrer views :\

    EDIT: sorry, this was because there is no "views" subfolder in the "official" release of this module for D6, so i just copied my old views subfolder which is the same as one in one of the zip files in a previous post on this thread, cleared my cache under Performance, and ran mysite.com/update.php and it works fine again. phew.

    chrisroditis’s picture

    Yes, views support should be committed to the 6 release, RTBC applies to it too I believe, people use it with no probs.

    andypost’s picture

    Title: Nodereferrer Drupal 6 patches + zip » Nodereferrer Drupal 6 patches + zip + Views integration

    #141 last patch

    Title changed to track state

    @dopry can you submit cacheges and make 6-dev release then more people can test!

    SeanBannister’s picture

    Sub

    ec’s picture

    Dear all,
    For those who are lost with the various patch, please find attached a full folder with the nodereferrer I'm using with the pacth and views integration found in this thread. Please note that I didn't do anything by myself, I'm just using the great work found here. The tar ball is just provided to help testing.

    By the way, +1 for all the work, as everything works as espected on my test site.
    Regards,
    Eric

    dopry’s picture

    @andypost: would you like to become the maintainer of nodereferrer?

    andypost’s picture

    @dopry agree as co-maintainer but have no cvs access

    dopry’s picture

    @andypost: apply for a cvs account and let me know what your cvs username is... we'll get you squared away.

    AjK’s picture

    CVS account application approved.

    robpomeroy’s picture

    The excitement builds! Subscribing.

    andypost’s picture

    Commited views folder, most of #141 except

    -      'multiple values' => CONTENT_HANDLE_MODULE,
    +      'multiple values' => CONTENT_HANDLE_CORE,//MODULE,
    
     function nodereferrer_content_is_empty($item, $field) {
    -  return FALSE;
    +  return TRUE;
     }
     

    Enabled 6.x-dev release

    robpomeroy’s picture

    Fantastico! Thanks Andrey.

    Can this issue be marked "fixed" or "closed" now?

    loupster’s picture

    And can these changes finally be included to the nodereferrer module? No bonus with patching nodereferrer-6.x-1.x-dev.tar.gz

    Cheers,
    Ville

    andypost’s picture

    @loupster all changes except #172 included

    nodereferrer-6.x-1.x-dev.tar.gz should be tested

    WorldFallz’s picture

    Status: Reviewed & tested by the community » Fixed

    Then I would suggest we go ahead and close this issue and log new issues against the proper dev/release. This one is quite long enough.

    WTG andypost! Thanks for taking this on. I'll test out the dev and report back as soon as I can.

    tagsko’s picture

    #105 thank you thank you thank you! This solved a long standing problem of mine!!!!

    Alice Heaton’s picture

    Then I would suggest we go ahead and close this issue

    Hurray ! This one has been long and painful ! It took quite a few different contributors, but finally it's here :)

    andypost’s picture

    goin to new issue #397654: Multiple values

    Status: Fixed » Closed (fixed)

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