Support refreshing of blocs in panels
I am opening this issue to consolidate the issues with the initial release of Block Refresh with Panels support to one thread.
Please post general discussion below. Specific issues relating to Panels support should go in a new issue with this issue marked as the parent.
I look forward to getting this stable very soon!
Current implementation:
- There is now a checkbox on the block's configuration screen allowing for the block to be used in Panels.
Known Issues:
- If a block is used as a regular block AND is used as a block within Panels on the same page then they will both be refreshed together. Not sure that this will actually come up in production implementations, but I did notice it in my initial tests so I wanted to mention it.
Any patches on how to make the UI more user-friendly and/or better approaches to writing the code for this functionality would be MUCH appreciated!
Comments
Comment #1
ah0 CreditAttribution: ah0 commentedThank you for your efforts as this is a real need for the block-refresh mod.
Please also note that while working on this, make the functionality work for the HOMEBOX module (http://drupal.org/project/homebox) as well.
HOMEBOX is usually used as much as the panels or used in parallel.
also please ensure that if two panels are added to a page, and each have multiple blocks with block-refreshes, each block refresh can refresh independently from the other ones.
Once again, thank you.
Best,
Comment #2
thomas73 CreditAttribution: thomas73 commentedHi,
I've got "Call to undefined function block_refresh_submit_panels()" error message when wanted to add my block to a panel.
I've replaced "block_refresh_submit_panels" to "block_refresh_submit" at line 165 in block_refresh.module, and it works now! :)
Regards,
Tamás
Comment #3
mickey86 CreditAttribution: mickey86 commentedHello,
I have the same problem: view blocks (diaporama cycle) in a panel do not refresh, nor have the "refresh" button on it.
Note, the non-view block in the same panel seem working correctly (also the "refresh" button is displayed). So, it seem related to view blocks in panels.
I have tested the #2 solution (above) with no good results. The checkbox in the block configuration screen do not solve the problem…
Any new idea?
Comment #4
alfiozzz CreditAttribution: alfiozzz commentedSame here, not working inside panels, but working if used for a normal drupal block.
Also looks like this version of block refresh is not working with Internet Explorer 8. Can anyone confirm this ? To me in IE it just does not refresh at all, and if you set manual refresh on, IE does not even show the "Refresh" link.
Firefox is ok.
One little thing: could you please make the Refresh link look more like the theme is use? I know i can customize it but it'd be nice not to see a totally unstilyed link for now. It's a little thing, i said.. :)
Thank you.
p.s. For what I know at the moment this is the only working module that does ajax-refresh content in Drupal 7. Views + Views Hacks module(which provides a auto refresh feature) is not working for Drupal 7. Couldn't you like join forces so that your precious efforts can also be applied on Views+Views Hacks? ...Just my 2 cents :)
Regards
Comment #5
RaulMuroc CreditAttribution: RaulMuroc commentedAs I could test, any block (not talking about this particular "block refresh" module but normal blocks) introduced through Views + Panels does not refreshes. Otherwise, when they are blocks just with Views (without Panels) they refresh correctly.
The same for "block refresh" module.
Let's go further, panels doesn't refresh any entity field. For exampe, I created a text area fields under 'profile2' entity, I change repeatedly their value but it is not reflected/refreshed.
Mainly it looks that problem is on panels/ctools refreshing.
Comment #6
RaulMuroc CreditAttribution: RaulMuroc commentedAs you can see in the code, it's kind of a matter of design in panels. And thats a pity, because panel pages often serve as overviews of latest content. If used instead of the many blocks aside pages, these panel-pages help to scale traffic down on large sites. Reason enough to provide some way for blocks to work with panels.
Here is the code that might be responsible:
So just the blocks that are tied to regions are affected. I suppose panels define no page-regions. Someone who knows better about the region-design of panels2 might want to help out here.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedYes, Panels does not define regions. The very design makes it impossible.
It seems like a silly coding practice to do it that way, too. But I don't see what Panels can do about this.
Comment #8
AaronELBorg CreditAttribution: AaronELBorg commentedEDIT: I'm redacting this post since the behavior I got didn't translate to a site with multiple panes within a panel.
This is extremely quick and dirty so I apologize up front........
But within block_refresh.js you can add some custom code right before line 22 (this is line 22 untouched):
$('#' + element + ' h2').before(refresh_link);
To get the refresh link I added a new line with the panel ID I gave within the panel config ("the-gd-front-page") to line 23. (Maybe this will work out of the box if you don't give the panel an ID??? I don't know.....)
$('#the-gd-front-page h2').before(refresh_link);
And then within the "($'.block-refresh-button').click(function() {...." I added a new block of code to get my stuff to reload as well. Looks like this:
Again, this is so quick and dirty that I'm reluctant to post this. Obviously not that reluctant since you're reading it but, yeah, I gotta make this happen and maybe (just maybe) this will help someone.
Comment #9
AaronELBorg CreditAttribution: AaronELBorg commentedAre the settings getting set correctly?
Check out Drupal.settings:
"block_refresh":{"settings":{"block-views-refresher-block":{"element":"block-views-refresher-block","auto":0,"manual":1,"panels":1,"timer":"120","block":{"block":"views","delta":"refresher-block"}}},"args":["front-page","1","8"],"query":""},
In the firebug console I get "undefined" when I do this:
Am I doing something weird? In the block config, I have both 'manual' and 'put in a panel' (or whatever it is) checked but other than that, I'm not sure what I could've done to get things in such a wonky state?
Comment #10
egarias CreditAttribution: egarias commentedMaybe it is not the right place, but,
I have ajax error when editing a panel-pane
/panels/ajax/editor/edit-pane/panel_context%3Aterm_view%3Aterm_view_panel_context/5/form
tried to disable some modules but cannot find the way to save my block in the panel
Comment #11
egarias CreditAttribution: egarias commentedI changed as explained in #2 and the seems to work.
But in panels, Modifications on the block are not saved, seems to work with the standard block edit config, but changes are not saved in panels block edit
I have several errors in watchdog:
Comment #13
tripper54 CreditAttribution: tripper54 commentedI have just pushed an update that fixes the error in #2 and #11.
The refresh settings in the panel options form now also works (ie remembers and uses the settings).
We're not quite there yet, but blocks do actually refresh in panels!
I'm going to convert this issue to a meta issue. Please create separate issues for individual bugs and link to this meta issue.
Comment #14
tripper54 CreditAttribution: tripper54 commentedComment #16
tripper54 CreditAttribution: tripper54 commentedComment #17
NWOM CreditAttribution: NWOM commentedSince the changes have been committed, most likely this issue can be closed.