I am using views and random sort criteria along with block refresh to try and display a random teaser when a user clicks refresh. Everything seems to be working fine up until the moment I click refresh, at which point I am receiving Array instead of the content. I have tried with ajax enabled and disabled on the view itself to no effect. I have also tried without the random sort with the same problem. I have block refresh working fine on non views. What would be the best way to try and debug? I cannot see any error messages.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | return_array-1144106-3.patch | 560 bytes | idflood |
Comments
Comment #1
michaellander commented7wonders, let me try and replicate this and get back to you. Do you have this issue with the auto refresh by chance?
Comment #2
7wonders commentedI suppose it would have been smart of me to try that before posting :)
But yes, it also gives array on the auto refresh. Let me know what I can do to help debug. Im using latest dev of pretty much everything.
Comment #3
idflood commentedI had the same issue with a block from another module. The issue seems to come from the fact that blocks can now return their content as string or renderable array. Here is a little patch that should fix this.
Comment #4
idflood commentedComment #5
michaellander commentedThere was a slight typo in the is_array, but i'm rolling it in as we speak. It will be in the next release. Thanks for your help idflood!
Comment #6
idflood commentedgreat : )
But I should have read the source of render() before creating the patch. The is_array check is included in it, so it could have avoided me this typo.
We can then theoretically remove the if/else and just do:
print render($block['content']);
( http://api.drupal.org/api/drupal/includes--common.inc/function/render/7 )
Comment #7
michaellander commentedhaha dangit, maybe I should have read it as well. I'll roll it into DEV for the next update.
Comment #8
michaellander commentedIn dev. Thanks!