node redirector, integration and translation
| Project: | Comment mover |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | won't fix |
You are a life savier, THIS is the module I was dreaming of !
I checked for a suport forum or any place to talk about this module and fount none so I posted here. My apologies if it is misplaced.
To my opinion there are a few minor tweaking that could improve how it integrate. If you find it makes sence, all the beter, if not, I'll just have to hack each release...
Don't blame me on the code layout, I focussed on not chanching lines numbers ;)
Feature 1:
When you convert a node to comment you set a node redirector with a php drupal_goto. ONLY the site admin can edit this node using the admin content listing for acess (that desactivate the embeded php for editing)
To gain access in a regular fashion and to be consistant with comments I propose to set an html message instead
Replace line 335 :
$object['body'] = "<? php\ndrupal_goto('node/". $comment['nid'] ."', NULL, 'comment-". $new_comment['cid'] ."')\n?>"; $object['body'] = t('This content has been moved <a href="%url">here</a>.', array('%url' => url('node/'. $comment['nid'], NULL, 'comment-'. $new_comment['cid'], TRUE)));For consistancy again and to simplify translation work I would also replace "comment" by "content" in the text of lines 297 and 330.
Feature 2:
It is a question of phylosophy but I find the "Graft block" very ungracefull.
To get rid of that block I propose to :
-Add a contextual "cancel" link, (apear on all nodes and comments when prunning is activated)
Replace lines 71 AND 85 :
} $links[] .= l(t('cancel'), 'comment/cancel', NULL, drupal_get_destination()); }-Add a contextual "convert" link, (appear on the selected comment when prunning is activated)
Replace lines 63 TO 70 :
// Display graft link when
if (comment_mover_allows_grafting('comment', $object) && // grafting is allowed on the node type
$prune->cid != $object->cid && // comment is not the pruned comment
!($prune->nid == $object->nid && $prune->cid == 0) && // comment is not a child of the pruned node
!in_array($object->cid, comment_mover_get_children($prune->cid))) { // comment is not a child of the pruned comment
$links[] = l(t('graft'), "comment/graft/$object->nid/$object->cid");
} // If grafting is allowed on the node type
if (comment_mover_allows_grafting('comment', $object) ) {
// If comment is not the pruned comment AND comment is not a child of the pruned node AND comment is not a child of the pruned comment
if( $prune->cid != $object->cid && !($prune->nid == $object->nid && $prune->cid == 0) && !in_array($object->cid, comment_mover_get_children($prune->cid))) {
$links[] = l(t('graft'), "comment/graft/$object->nid/$object->cid"); }
else if( $prune->cid == $object->cid && node_access('create', 'forum') ) { // If comment is the pruned comment AND user can create forum topics
$links[] .= l(t('convert'), 'comment/move/'. $prune->nid .'/'. $prune->cid); }
}-Add a cancel link on the "Convert to forum topic" form page
Replace line 120 :
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit')); $form['submit'] = array('#type' => 'submit', '#value' => t('Submit')); $form['cancel'] = array('#value' =>l(t('cancel'), 'comment/cancel', NULL, drupal_get_destination() ));That way the added block becomes pointless and we can get rid of all its related code.
I'm fairly new to drupal and php and I can't see a simple 1 line modification to include the return to
the selected content AND the comment_mover_unset() into the "confirm_form" cancel link. Might come up
with further work and code optimisation.
Feature 3:
I have a POT and a French translation to propose for the actual version (dated 06/08/03, see attachment)
Once again thanks a lot for this GREAT module.
| Attachment | Size |
|---|---|
| comment_mover.zip | 2.27 KB |

#1
thanks, can you provide a patch instaed of a zip file? see http://drupal.org/diffandpatch
#2
I'd love to do that but I'm afraid I won't be able to get my hands on an unix like shell before 2 weeks.
If there is no changes in between, I'll give it a try.
#3
This is my first "patch" so tell me if I got it right...
Plus the related fr.po translation
#4
please attach the files unzipped.
#5
Sorry about that, feel kinda noobs on this :(
Here is the patch.
#6
here is the related fr.po
#7
I very much like the replacement of the node redirector with a simple link to the new location.
I do not like the replacement of the block with links, in particular:
1 - cancel links everywhere.
2 - no reminder on other nodes which node/comment is being moved
3 - the block may be extended.
2 - can be solved by using 'graft %title' links, but this makes the comment link area very full.
See for example http://drupal.org/node/72580 (example patch) where the block is extended with a form to provide conversions to several different nodetypes.
Is the block an sich ungraceful or could its layout be improved?
#8
O, and it's best to make multiple issues for unrelated bugs/feature requests.
Now if comment_mover supported additional node type conversions and the relevant project module used real comments we could split such multi-issues. One can only dream :)
#9
All this is a question of point of view and design I guess.
1 - at first I made the cancel link apear only on the selected content. Then, while browsing around I figured that it was better to have it at hand everywhere. This is an easy and dirty way to achieve it, it sure can be improved.
2 - usualy when I prune/graft a content I don't go for a cofee in between so i don't see any uses of a reminder of the content title. (well sometime I do, but then, I just cancel and restart over since I forgot the message content)
3 - only extention I can think of is multiple node type convertion which can be achieved targeting a "what type of node do you want to convert to" form.
The block could be pink with flowers, the point is that I'm really not fond of a contextual block popping up and messing the other blocks positions.
Maybe it could be integrated in the main nav menu but that wouldn't solve the issue since that block may be desactivated.
In fact, the whole idea is about not having a block at all ;)
#10
Yes *shamefull*
I'll work on posting one topic per thread...
#11
I've split off the node redirection part & the associated language change in http://drupal.org/node/81601.
#12
#13
Closing, 4.7 is no longer being supported or maintained.