Attached is a diff file which adds support for tokens.Credit to CCK nodereference for inspiration.

/Kevin

Comments

danielb’s picture

Priority: Major » Normal
Status: Needs review » Needs work

I was unable to apply your patch

danielb@DAEDALUS /c/git/revisionreference (6.x-1.x)
$ git apply -v revisionreference-6.x-1.4-token-support.diff
Checking patch revisionreference.module...
Hunk #1 succeeded at 6 (offset -1 lines).
error: while searching for:
$max_vid_for_nids[$nid] = db_result(db_query(db_rewrite_sql("SELECT MAX(vid)
AS vid from {node_revisions} WHERE nid = %d", 'node_revisions', 'vid', $args),
$args));
}
return ($max_vid_for_nids[$nid] == $vid);
}

error: patch failed: revisionreference.module:805
error: revisionreference.module: patch does not apply
Checking patch revisionreference.token.inc...
revisionreference-6.x-1.4-token-support.diff:29: new blank line at EOF.
+

kevin.mcnamee@mailbox.org’s picture

Status: Needs work » Needs review
StatusFileSize
new2.38 KB

Hi,

nothing wrong with the patch as far as I can see. Git seems to have a problem handling a new line at the EOF is all. I have rerolled the patch without the new line.

I was unsure how to get a new file into the diff, so I have just touched the revisionreference.token.inc file in the original directory first. You can do the same if Git complains about that too.

I am unfortunately working in Solaris using just vi and diff tools in case this all seems a bit retarded.

/Kevin

danielb’s picture

I could probably add that in manually.

I think whatever technique you're using to do patches, shouldn't require you to create a folder such as 'revisionreference_new'. That's how I did it back in the CVS days, but in git I just change the checked out code and diff it against what's on the server, which is the default that the diff command does.

kevin.mcnamee@mailbox.org’s picture

I'll start doing that from now on I think.

danielb’s picture

Assigned: Unassigned » danielb
danielb’s picture

Status: Needs review » Fixed

I've simplified the code a bit and added it into 6.x, but I have not ported it to Drupal 7, someone will have to make an issue for that and provide the code.

Status: Fixed » Closed (fixed)

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