Jump to:
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | node system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
What if one wants to automatically strip tags from the node title submitted by the users, when they click on 'Preview'?
In hook_nodeapi(), 'presave' can modify the title just before the node is going to be submitted, but not when the node is going to be previewed.
I know it's considered bad style modifying the data when validating.
But I'd like to automatically modify the node title even when previewing the node itself.
I don't want users have to modify it manually (IOW, I don't want to use form_set_error()).
I think I could also do it using hook_nodeapi() when $op is 'view' (and 'alter'), but this means my code will be ran each time a node is viewed, and that's not good: I'd like to run it only when the user is going to preview/insert/update the node.
I really think it should be inserted something like a $op == 'preview' action to hook_nodeapi():
Am I wrong?
Greetings, Giovanni
Comments
#1
Any thought about this?
#2
At this point, no new features will be added to D6. If you think Drupal 8 needs this feature, please assign this issue to D8.
#3
It is possible to use $op = 'view' and check if node->build_mode = NODE_BUILD_PREVIEW;