Issue a page redirect after content creation...

Submitted by fago on Thu, 12/13/2007 - 13:41
That sounds really easy, not? Indeed one can easily configure that with workflow-ng as well as using the node go to module. But.... just using drupal_goto() to redirect to the new page breaks drupal's node access API as the node access grants are written after nodeapi 'insert' was invoked. If one uses nodeapi to create the redirect (like the node go to module and the workflow-ng solution), the grants doesn't get written any more.... Node go to issue: http://drupal.org/node/193944 workflow-ng issue: http://drupal.org/node/196445 Furthermore any other modules doing their job on nodeapi after the module issuing the redirect, won't be able to do so too. E.g. specified path aliases won't be saved any more. The list of possible problems is endless.. But how to redirect in clean way? I added an option "Override another path redirect by setting the destination parameter" to workflow-ng's path redirect action. Usually one get's redirected to 'node/ID' after content creation - with this option checked the redirect isn't applied immediately as previously but the already in place redirect gets overridden by a specified destination parameter. As an affect the node grants are written as usual and everything keeps working :) To help workflow-ng users deciding whether they should check "override" the action now provides a sensible default value for the option. For this events may specify a new property, which helps the action setting an appropriate default value. Developers check out the new event property #redirect.