Closed (fixed)
Project:
Views Auto-Refresh
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jul 2011 at 14:48 UTC
Updated:
29 Apr 2013 at 13:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
steinmb commentedA more descriptive title perhaps.
Comment #2
neoglez commentedYes, it hasn't been ported jet, that's why the 7 branch doesn't show in the project page.
Comment #3
steinmb commentedI could see that :) still I decided to post an issues, so other might see this before turning on the submodule (nothing is stopping you from getting the code with 'drush dl views_hacks' + we could keep this as an meta-issue that we close when the submodule is ported/working.
Comment #4
neoglez commentedOK ;-)
Comment #5
drupalina commentedsubscribing (I have the same isssue -- and waiting for the port)
Comment #6
JohnnyX commentedMaybe views_autorefresh could be done with jquery spy plugin to update/ add new content at the top/ bottom (with slide effect)? I dont't know if views hack (D6) refresh the hole view or update it like spy. It would be a great feature.
Comment #7
mhawker commentedsubscribe
Comment #8
cm_is commentedsubscribing
Comment #9
vali hutchison commentedi tried downloading the module and trying to update to D7 to no avail. for ref i changed
$query_string = drupal_query_string_encode($_REQUEST, array_merge(array('q', 'pass'), array_keys($_COOKIE)));to
$query_string = drupal_http_build_query(drupal_get_query_parameters($_REQUEST, array_merge(array('q', 'pass'), array_keys($_COOKIE))));as per http://drupal.org/update/modules/6/7#get_querystring
it gets rid of the errors mentioned above, but when i set up the view with AJAX switched on and the refresh code in the header, nothing happens.
Comment #10
dreadlocks1221 commentedto get the script somewhat working I changed
Drupal.behaviors.views_autorefresh = function(context) {
to
Drupal.behaviors.views_autorefresh = {
attach: function(context, settings){
and added an extra } before })(jQuery);
The js tries to refresh but I get an error:
Drupal.Views.Ajax is undefined line 63
this error could be related to:
http://drupal.org/node/914360
as it doesnt seem like this function is present in the D7 views js
Comment #11
neoglez commentedCould you give an export for this specific use case so i can test a port to D7 and eventually commit?
Comment #12
l00ph0le commentedLooking for this for a project as well...any idea on a port to D7?
Comment #13
alfiozzz commentedAn AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /drupal/admin/structure/views/view/frontpage/preview/page/ajax
StatusText: Internal Server Error
ResponseText:
Comment #14
l00ph0le commentedEnabled the new D7 Dev ports...here is my errors...Picture is on the views page when configuring and saving, and the WSOD Fatal error.
Fatal error: Call to undefined function drupal_query_string_encode() in /home/hillsdal/public_html/drupal/sites/all/modules/views_hacks/views_autorefresh/views_autorefresh.module on line 20
Comment #15
kaizerking commentedI suggest to keep the title of the error , when i search for this in issue cases i didn't get this,
What we generally do is search the issue in titles or search with key word in bothe the cases we dont get this title.
I also have the same issue
Comment #16
kaizerking commentedPS :here is the error code i am getting in my view settings page
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/view/new_jobs/preview/page/ajax
StatusText: parsererror
ResponseText:
Fatal error: Call to undefined function drupal_query_string_encode() in E:\wamp\www\sites\all\modules\views_autorefresh\views_autorefresh.module on line 20
Comment #17
ironbuilt commentedSubscribe. Can I offer a bounty to get this resolved? ;)
Comment #18
mentor972 commentedNew D7 dev version no longer has errors when you add the autorefresh code to Views Header, however, the view doesn't actually refresh.
Steps..
1) Turn on AJAX for view
2) Add Text Header PHP...
"
"
3) Check box to display even with no result
4) Active view doesn't refresh.
Thoughts?
Comment #19
steinmb commentedRemoving tags
Comment #20
mentor972 commentedAlready tried removing tags, but that just makes the code display in the header. Plus, Views Header states you need tags at the bottom.
Comment #21
Niremizov commentedLike mentor972 said, just nothing happens. Probably it is some how related with that inside views_autorefresh.js there is lines:
And there is not property _callback... so nothing happens. Ajax response returns command objects, that we should invoke some how, i tried something like:
But it didn't work, suppose we should create Drupal.ajax object first, or what?
Comment #22
rlmumfordHere's my code for views_autorefresh.js, It works for me. Hopefully it will be helpful
Comment #23
aggentle commentedrlmumford, that works a treat.
I tried the standard alpha release install with no joy. I replaced the packaged views_autorefresh.js file with your code and both my block and page views are auto-refreshing nicely.
Thanks to all.
Comment #24
Niremizov commentedThx rlmumford espessialy for example of useing Drupal.ajax.
There is error in Chrome, "clearTimer is not defined" -- replace it with clearTimeout.
PS: if someone searching for more examples and explanations of useing Drupal.ajax, you schould see.
Comment #25
Cristian.Andrei commentedhere's a patch (contains the important bits people mentioned above) for the views-autorefresh.js that will work on D7. Tested on a vanilla install. Apply it in the views_hacks root directory.
Thank you all for the contribution.
Comment #26
Cristian.Andrei commentedforgot to mark the right component
Comment #27
Cristian.Andrei commentedthere's some legacy stuff from my testing in the last patch. This patch is clean, so use this instead of the one in comment #25.
Comment #28
steinmb commentedI'll test it on a larger site this weekend and let you know. Unable to give any proper code review then js is my native language. Kitos! :)
Comment #29
infojunkieThanks for this patch. As I'm about to use Views Auto-Refresh on a D7 project myself, I will be reviewing it shortly.
Comment #30
infojunkieCommitted to latest dev, with some changes. Thanks!
The Views Auto-Refresh module in D6 had greatly progressed since this version though, including a ping URL and a progressive refresh mechanism. These functionalities are not included in this commit. I am working on them.
Comment #31
infojunkieAdded support for ping script.
Comment #32
infojunkieAdded support for incremental refresh. This completes the port of Views Auto-Refresh. Please open new issues if you encounter problems.
Comment #33
JohnnyX commentedGreat news! Thanks! I'll test it soon.
Comment #34
JohnnyX commentedAnxy documentation how to use it?
Comment #35
infojunkieHere are 2 articles on how to use it:
http://thereisamoduleforthat.com/content/auto-refreshing-views-real-time...
http://thereisamoduleforthat.com/content/auto-refreshing-views-part-ii-o...
Comment #36
JohnnyX commentedArticles also correct for D7 module?
An alternative way could be nodejs integration? I haven't work with nodejs, but it sounds like a good solution... but needs nodejs installed at server.
http://drupal.org/sandbox/julien/1502728
Comment #37
infojunkieNodejs is not needed. A simple PHP script suffices. You should read the articles :-)
Comment #38
JohnnyX commentedI have take a look at the articles and tried it with a simple complete refresh test, but it doesn't work. PHP code displayed at the view and not executed. Also doesn't work with views_php module installed.
I'll try it again...
Comment #40
infojunkie