I have some custom content types which are using the Auto Nodetitles module (http://drupal.org/project/auto_nodetitle) along with Token to generate node titles from CCK nodereference fields. This worked up until 6.x-2.0-rc7. Now, I can't get nodereference fields to show up in the titles. As far as I can tell, all other types of CCK fields still work. The nodetitles work properly again after downgrading CCK to rc6.

Let me know if I can provide any more info.

Comments

yched’s picture

Status: Active » Postponed (maintainer needs more info)

Strange, the code that handles tokens hasn't changed since RC5...
What's the output format used by this field (in the 'Display fields' tab for this content type) ?

jerdavis’s picture

Status: Postponed (maintainer needs more info) » Active

Can you clarify what you're looking for yched?

We're having the same problem, and it's not just limited to auto title. We're also not able to access the title of the node referenced node through a views query using rc7. The title of the referenced node just does not seem to be made available by cck in this version.

jerdavis’s picture

It looks like this is more than just a token issue. There seem to be a number of changes to node reference between rc6 and 7 - and as I mentioned we're having issues accessing the referenced title even in views. I've tried sifting through a diff between 6 and 7 and unfortunately nothing's jumped out.

If you need any more information please let me know, this is a pretty critical item in an active project I'm working on so any thoughts you have would be great!

jerdavis’s picture

Priority: Normal » Critical
yched’s picture

Status: Active » Postponed (maintainer needs more info)

"we're having issues accessing the referenced title even in views"
You need to be more specific. What do you do (detailed views settings plz), what do you expect, what do you get instead ?

What I was asking in #1 was :
go the the 'Display fields' tab for the content type involved. What are the display options for this noderef field.

jerdavis’s picture

Status: Postponed (maintainer needs more info) » Active

There are no display options for the nodereference field, it does not show up in the list of fields with options.

As for the views, we have content type A with a node reference to content type b. We are trying to include the node title from content type A as a field in the output of the view when listing items from content type b. We have the node reference between the two loaded as a relationship. We add the field for the title using that relationship. The field representing the title of the referenced node is empty.

yched’s picture

Status: Active » Postponed (maintainer needs more info)

"There are no display options for the nodereference field, it does not show up in the list of fields with options."
Er - sorry ? Are we talking about admin/content/node-type/TYPE_NAME/display ?
If there is no row for your noderef field in this table, then maybe this explains that...
Does it at least appear on the 'Manage fields' tab ?

"we have content type A with a node reference to content type b. We are trying to include the node title from content type A as a field in the output of the view when listing items from content type b."
Sounds incorrect.
If the noderef field is in content type A, then you can't have it when listing nodes of content type B. Noderefs are not bidirectional.

jerdavis’s picture

Status: Postponed (maintainer needs more info) » Active

Sorry, I need to correct that. Had my example backwards.

1) The node reference field does show up on display settings. Label, Teaser, and Full Node are all set to hidden. RSS Item is set to Title. It does also show up in manage fields. Sorry for the confusion!

2) In my example for views, the reference is pointing the other (correct) way. From the type being listed to the type we are trying to pull the title from.

yched’s picture

"Teaser, and Full Node are all set to hidden"
Then look no further. See #153561: other modules cannot access <hidden> CCK fields.

About your View, this might be because of #306604: Views relationships broken with 'group multiple values'

yched’s picture

OK, this issue has drifted away from the original bug report.
It does look like $item['views'] is not populated anymore when rendering the node for tokens.
Investigating.

richardhkirkando’s picture

yched - The output format for the fields I'm having trouble with are all set to "Title (link)" (currently, after downgrading to rc6) - unsure if that selection showed up with cck rc7. I'm also using views that refrence node titles, but I didn't check those before downgrading. I'll have to set up a test site tonight to find answers for your other questions.

edit - didn't see your last reply. Let me know if you need me to test anything on my setup.

yched’s picture

Got it. This is caused by the preprocessor refactoring I did when adding the new $NODE_FIELD_rendered variables in node templates. To add consistency, I also moved the part that populates $item['view'] to the template preprocess step, which token generation doesn't access.
This is also causing #309785: ...['view'] element not available?.

I'll probably have to roll that back, I'll think about it for a short while.

(this won't solve the fact that 'hidden' fields are inaccessible for tokens, which is a separate issue)

Allie Micka’s picture

Right, In our case it's the title, and not a field that can be hidden. E.g. the node autotitle setting is [field_item-title] where "field_item" is a nodereference field. I expect the referenced node's title to appear here, but it comes up blank.

The behavior is similar in Views, where we have "(field_item_nid) Node: Title" As in, the title of the node from the field_item_nid relationship. Again, this is blank.

These two issues may be unrelated.

yched’s picture

Allie : the -title token is generated from the 'view' item - which is bad, but avoids an additional query to retrieve the title.

The views / relationships issue is not related : again, see #306604: Views relationships broken with 'group multiple values'

yched’s picture

Title: Auto Nodetitles stop working with nodereference in RC7 » token / contemplate broken - missing $item['view']
Status: Active » Fixed

Should be fixed now in 6.x-2.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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