I have a cck text field which I do not wish to display when viewing the node, however I do want the value to be part of the URL using pathauto. To achieve this, I set the field display to and used [field_myfield] in the pathauto configuration. This ended up giving urls like nodetype-nnn. I found the following in content_pathauto.inc on line 49:
$results['['. $field['field_name'] .']'] = pathauto_cleanstring(strip_tags($items[0]['view']));
So the problem seems to be that the module is just using the 'view' component of the field. The automatic nodetitles module allows the user to choose between the formatted and raw values. I think a similar functionality would be beneficial for cck pathauto as well. If there is interest in this feature, I could make a patch and submit it for review.

Comments

schuyler1d’s picture

content_pathauto.inc calls hook_pathauto_node() which is no longer used.
This should be replaced with the file:
token/token_cck.inc

which implements the new hookd:
hook_token_list()
hook_token_values()

The issue for this module is in line 10 of token/token_cck.inc which calls content_view().

Below is a patch to replace token/token_cck.inc with content_pathauto.inc
Obviously, this will depend on token module removing the same file.
(note: patch doesn't solve the reported problem, but is required before going forward)

add file content_token.inc
remove file content_pathauto.inc
and apply the first patch to content.module

karens’s picture

I double-checked with greggles and confirmed that we do not need the content_pathauto.inc file in the D6 version and that it would make sense to add a content_token.inc to CCK instead of in the Token module. Once all of that is done, we have control of how the tokens are handled and we can make any other changes that are needed.

I am committing the removal of content_pathauto.inc and adding in content_token.inc.

greggles’s picture

Subscribe so I can know when to remove the token support.

Thanks karens and schuyler1d.

greggles’s picture

So, based on this I guess some of this is "fixed" and I can remove the token_cck?

schuyler1d’s picture

I believe KarenS only copied in the core cck support, so imagefield and link still need support, until these are resolved:
http://drupal.org/node/231339
http://drupal.org/node/231335

drewish’s picture

well since imagefield and link don't have official 6.x releases, i'd say it's safe to pull it from core and those modules can add it when they do their update.

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new2.19 KB

I've ported Link to Drupal 6. I think it'd make sense for me to include this in link.module directly rather than have it be part of CCK. To keep a lot of people from experiencing duplicate function errors, could you remove the link (and imagefield) token support? I'll add them into the respective modules once it's taken out of CCK. Thanks!

drewish’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.33 KB

re-rolled for HEAD. this is an easy commit, and once it's in we can move them to the respective modules.

karens’s picture

Status: Reviewed & tested by the community » Fixed

Sorry! This was not supposed to have gotten in there in the first place, but it's (finally!) removed. At least I got it out before we roll an alpha release :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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