backdrop-contrib / block_refresh

Allows blocks to automatically refresh their content.
GNU General Public License v2.0
1 stars 1 forks source link

No button/link when configured to manually refresh #3

Open klonos opened 4 years ago

klonos commented 4 years ago

This problem has previously been reported a few years ago in #1, but also now in the forum: https://forum.backdropcms.org/forum/how-block-refresh-help-needed

  • I set up a view showing newly posted content, set the block to update every 20s and manually. Only 1 item, no pager.
  • Expectation: When posting new content that given content will updated into the "new content"-block within a short time.
  • What happens: The block shows the block title, the current newest content but no "refresh"-button, after ~20s the block updates as required, now displaying the refresh button but no content, hitting the refresh button has no effect

I have tried the following:

  1. added the "Promoted content" block in a layout, and have set it to auto-refresh at the default of 120sec.
  2. in a separate browser tab, I've updated both the title and body text of the "Your first post!" post.
  3. allowed 120sec to pass -> the block vanished 👎
  4. edited the block, and changed the refresh method from auto to manual -> saved the block and layout
  5. cleared caches -> no link/button on the block to allow me to manually refresh 👎
klonos commented 4 years ago

@jenlampton you've previously mentioned that you are using this module in one of your sites (something about an online radio station), does it still work as expected in that site? Can you have a look please?

PS: I hope that you do not mind me wearing my Bug Squad hat and removing the outdated comment about the core fix/patch from the README: https://github.com/backdrop-contrib/block_refresh/commit/7a2e43870212de502b2ac07174e2e37ff5880a87

jenlampton commented 4 years ago

I hope that you do not mind me wearing my Bug Squad hat

As long as you are following the rules, and only merging PRs that have been marked RTBC for 2 weeks ore more then it's fine with me ;)

jenlampton commented 4 years ago

you've previously mentioned that you are using this module in one of your sites (something about an online radio station), does it still work as expected in that site?

That site has since retired, but it's also not working on my local copy :/ PRs welcome!

jenlampton commented 3 years ago

I'm using this block on another site, and the Refresh on page load setting is working as expected. (This allows the block to be refreshed even when the rest of the page remains cached, and served from a CDN.)

I'm looking at how the module works with the manual setting, and it appears that the javascript that adds the buttons to the block still has some issues. The results of this function are returning FALSE:

$.get(path, function (data) {

I'm not great with jQuery, and my googleing of "Can jQuery .get use a relative path" isn't returning any useful results. I'll compare to Drupal 7 and see what it's doing there next, but if anyone with jQuery skills wants to pick this up I'd appreciate the help :)

jenlampton commented 2 years ago

@klonos I fixed the "Block not refreshing as expected" part of this issue in another issue, but I've not yet addressed the missing buttons for manually refreshed blocks so I'm keeping this issue open to work on that.

I did discover that the class name for the block was being constructed incorrectly, so that was really throwing a wrench into the poor jQuery. I think this should be easier to sort out now.