Hello,
I've been going through the issue list and the supplied example files, and I'm wasn't sure if this has been addressed, but here goes:
Without popups, when you create a node, Drupal redirects you to the created node when you submit the node form. How do you do that with popups? I've gotten it to tell me the node's been created, it to refresh the current page, and do nothing on form submit, but I'm not sure how to get it to redirect to the created node.
Thanks,
Mark Trapp
Comments
Comment #1
mark trappAll right, now that I've figured out how the hook works, I'm halfway there (I think). It appears hijackDestination is part of it, but I can't seem to get popups to reload using that destination. Instead, it just loads the destination into the confirmation popup (so I see "Type: Foo has been created" followed by the node area part of the created node).
This is what I'm using for my hook:
The updateMethod doesn't seem to add anything to it: removing it produces the same effect.
Comment #2
mark trappFinally figured it out, hopefully it'll be of use to someone else in the future. I don't think the solution is obvious: it required me looking at a few patches and reading popups.js to figure out the correct options.
Understandably, the module is still in alpha, but it'd be nice if this was a little more streamlined or documented. I think the main issue is that doneTest and updateSource are documented as being relevant only to multiform flows, but creating a node isn't a multiform (right?).
This hook tells popups to not hijack the destination, check to see if the path returned by the form submission is equal to node/[nid], and to reload the page with the path the form submission gave (i.e. node/99).
Comment #3
kristen polI don't see hijackDestination in the code anymore.
Kristen
Comment #4
mark trapphijackDestination was added in 2.0: did you download the 1.3 release instead? Popups API is no longer maintained, and hasn't been updated since long before this request was placed.
Comment #5
CoreyMoore commentedThis code is not working for me. I'm using Pathauto, so I am assuming that I need to use a different regexp for doneTest?
Comment #6
areynolds commentedYeah, I'm having some issues with this code too. It all makes sense according to the readme, but the popup seems to be ignoring my form's redirect path and instead displaying the popup's parent page inside of the popup. I'm assuming that it's a problem with my doneTest, so I tried dumbing it down just to see it work:
I've set my form redirect in the submit function:
The redirect is functioning correctly on normal pages.
Any ideas on how I'm screwing up here? Just general ignorance of regular expressions?
Comment #7
mark trappI personally haven't used Popups API in at least a year, I don't know why your code isn't working. But bear in mind that I posted these code snippets in February, 2010 (Over a year ago): there's probably a good chance that the code no longer works due to the past year's worth of development.