Hello,
Thank you for this module. I just installed it today and was toying with it and I believe I came across a minor bug.
I have a content type whose type field consists of an underscore (i.e., test_content). Drupal converts this in the URL to test-content, however when Draft pulls the content it's using node type and it pulls in the underscore format.
This causes problems when viewing a saved draft in draft/list:
VIEW link points to: node/add/test_content?draft_id=3
Drupal expects: node/add/test-content?draft_id=3
So this consistently bounces me into the generic content creation page since Drupal doesn't know what test_content is.
This is minor in that I'll just tweak my content types to not have any spaces, therefore removing the need to an underscore, but thought that I would bring this up in case someone else comes across the problems.
Thanks again for the mod!
Comments
Comment #1
jclaussen commentedThank you for posting this issue. Saved me alot of time.
Comment #2
darren.ferguson commentedThanks for the bug update, will address this issue in the coming days and put the fix into the nightly dev build.
Comment #3
nquocbao commentedI will update it here http://drupal.org/node/368030 :-D
Comment #4
darren.ferguson commentedWe have created this and i will put online hopefully today
Comment #5
adshill commentedWas this updated? I've updated to the dev version and the problem still exists. Any chance of an update? :)
Thanks a lot,
Adam
Comment #6
adshill commentedIf I have worked this out its a major achievement for me as I don't know php at all... (I know I shouldn't get excited but... it feels good to contribute instead of always asking :)
Anyway... correct me (pleease!) if I'm wrong, but the fix is in line 18 of draft_views_handler_field_draft_view.inc
You need to replace:
$output = l(t('View'), 'node/add/'. $values->drafts_node_type, array('query' => array('draft_id' => $values->drafts_draft_id)));With this,
$output = l(t('View'), 'node/add/'. str_replace('_', '-', $values->drafts_node_type), array('query' => array('draft_id' => $values->drafts_draft_id)));Seems to work for me anyway. Sorry I couldn't submit a patch but I don't know how to use patching yet so... one step at a time!!
Adam
Comment #7
geodaniel commentedIt looks like that's the way this is handled in core as well (
$type_url_str = str_replace('_', '-', $type->type);on line 21 of modules/node/content_types.inc), so that's probably sensible.Comment #8
darren.ferguson commentedThis is now handled in the version that is in CVS.
Closing this issue.
Comment #9
darren.ferguson commented