Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
OG adds automatically destination parameter to content create links if you use Panels plugin. In some cases it would be needed to remove that destination so that user could be redirected to a new node page after submitting the node add form.
Here is a patch for it. It has been made against the latest release 7.x-2.4.
Comments
Comment #1
vaartio CreditAttribution: vaartio commentedComment #2
vaartio CreditAttribution: vaartio commentedOkay, I found the issue Can't unset og_node_create_links destination just a day after my post. It does not solve the problem if you use create links Panels plugin but gives a possibility to unset destination in other cases.
Basically the patch above remove the effect of #1983450 so I decided to modify my suggestion a bit. Attached is a patch that changes the behavior of og_node_create_links_content_type_render method only. It sets destination to FALSE if redirection is not selected on content create links edit form.
However, the current implementation of og_node_create_links method can be considered a bad API design:
It would be much more simpler and clearer to add destination only if it is passed as a parameter, as originally suggested on #1983450.
Comment #3
amitaibuCorrect status
Comment #8
amitaibu... and correct version.
Comment #9
amitaibu2: og-optional-create-links-destination-2159073-2.patch queued for re-testing.
Comment #10
ranroz CreditAttribution: ranroz commentedWorks well and seems ok.
I made a few small cleanup changes.
Comment #11
amitaibuComment should be on 80 chars.
Looking at this I believe we need to change og_node_create_links() - either import the docs, or change the $destination argument.
Comment #12
ranroz CreditAttribution: ranroz commentedAdded better documentation for og_node_create_links() to distinguish better between the use cases of the function.
Comment #13
amitaibuI think you uploaded wrong patch. Also set status to "needs review"?
Comment #14
ranroz CreditAttribution: ranroz commented@amitaibu - Updated patch and status.
Comment #15
amitaibudestiantion => destination
Also I think the docs are a good start but needs a little cleanup. Maybe:
Comment #16
mccrodp CreditAttribution: mccrodp commentedI updated the patch with your comment recommendations.
Comment #17
MsArk CreditAttribution: MsArk at Metadrop commented#16 Works well. I tried it in version 7.x-2.9. Thanks