| Project: | Ajax |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jide |
| Status: | closed (fixed) |
Issue Summary
A new plugin for ajax : a plugin that reloads the view when submitting a form.
The ideal combination is a view listing nodes of a certain content type sitting next to the node submission form.
When you submit the form, the view would be refreshed and show the newly created node.
I have made such a plugin, but i have some problems to make it compatible with disable_redirect.
The problem is that disable_redirect hook 'complete' is fired before the plugin, and since it returns false, the hook is not fired for other plugins (that's what i guess, but i might be wrong). To make it work, i recreated the redirection disabling feature. Any help on this ? Otherwise, it works great !
The plugin is attached below.
| Attachment | Size |
|---|---|
| views_refresh.zip | 2.69 KB |
Comments
#1
Whoops ! It should have a dependency to the views module of course.
#2
Jide,
Thanks for your submission. This is actually the first user-submitted ajax plugin that has been submitted. I will test this plugin, and if all goes well, i will setup a page with a listing to all user-submitted plugins -- perhaps in a similar way that CCK lists cck plugins. I will keep you posted.
#3
Jide,
1) I have updated the ajax.js so that additional hooks will fire even after a hook returns false.
2) I have added an "unofficial contributed plugins" page, where a link to your module has been added. The page can be found here: http://drupal.org/node/436390 . Please be responsible for making sure this plugin is updated when appropriate and is in good working condition.
#4
Brendon,
This is great ! I would have prefered if it was included in the default plugins but i can imagine why you did not include it (you would have to maintain a plugin you did not create). Maybe i will publish a ajax_extra_plugins or something someday to make it easier for users to find, and then if other plugins are created they may be included in the package, what do you think ? In the meantime maybe you could add a link on the project page ? I'll try to watch for any change that may need an update. I already have to make changes to make it work along with disable_redirect now that you committed these changes.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
The 'complete' hook isn't being fired for me. To test the module out I changed the line:
if (hook === 'complete') {to
if (hook === 'afterMessage') {and it works for a single view (a view embedded within a view is a separate issue).
#7
Hello, has there been any updates to this plugin?
#8
I have updated the module according to recent changes in Ajax module.
I have implemented the change to the hook suggested by phonydream2 though it seemed to work for me with 'complete'.
Read the README.txt file for more information.
Enjoy !
#9
The refresh does not work for me using the default 'afterMessage'.
If I change that to 'complete' on line 22 of ajax_views_refresh.js then it works.
GMap has an issue with Ajax where it does not refresh, and there is an issue about it here : http://drupal.org/node/315236
This is using the Ajax Refresh .zip in #8 and Ajax 6.x-1.14
Cheers!
#10
I have published the plugin as a module which can be found here : Ajax views refresh.
Submit issues on the module's page.
kvnBushi : I changed the hook back to "complete" since i had the same issue and it seems to work well.
I updated Unofficial Contributed Ajax.module Plugins page accordingly.
#11
jide,
Perhaps you could make an OR condition to test for either hook.