Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Which leads to a query per node, or per comment, when anonymous users don't have access to post comments, just to theme the 'Login or register to post comments' link.
Comment | File | Size | Author |
---|---|---|---|
#6 | 537056-6.theme_comment_post_forbidden_static.patch | 1.51 KB | dww |
#1 | comment.patch | 1.38 KB | catch |
#1 | patch.png | 74.8 KB | catch |
comments.png | 207.49 KB | catch | |
nodes.png | 234.59 KB | catch |
Comments
Comment #1
catchOK this is just as broken, but for different reasons, just a bad drupal_static() conversion in comment.module.
Comment #2
catchComment #4
catchorly.
Comment #5
catchumm, bump?
Comment #6
dwwcatch asked me to review this in IRC. While the previous code was clearly broken, we don't actually need to avoid using drupal_static() entirely, we just need to use it properly. ;) If we initialize the static as NULL, we can test !isset() and set the real value for the variable. Also cleaned up the code comments a bit to clarify.
Comment #7
catchBoth changes make sense, think I just overreacted to the way we've been converting every, single, thing to drupal_static() indiscriminately.
Comment #8
webchickRe-worked some of the grammar on the comments and committed to HEAD. Thanks!