This module creates a function named "i18n_access_node_access", which is intended to be a menu access callback. Unfortunately this function also accidentally implements hook_node_access(), causing it to be called every time any node is viewed (such as from the default "node" front page). Right now it just throws a harmless PHP Notice about missing arguments, but could potentially cause all kinds of weirdness if it were updated in the future.
This patch renames the function from "i18n_access_node_access" to just "i18n_access_node". Don't worry there's no hook_node(), even in Drupal 7. :-)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | i18n_access_node_hook2.patch | 2.19 KB | quicksketch |
| #2 | i18n_access_node_hook2.patch | 3.22 KB | quicksketch |
| #1 | i18n_access_node_hook.patch | 2.22 KB | quicksketch |
| i18n_access_node_hook.patch | 2.5 KB | quicksketch |
Comments
Comment #1
quicksketchSorry that patch also has a separate notice fix in it, which I'll file separately. Here we are.
Comment #2
quicksketchI ran across a similar module the other day and it prevented this problem simply prefixing the function with "_". Seems like a good approach to me, so here's an alternative patch to #1, just putting an underscore in front of the function name.
Comment #3
quicksketchHeh, dang, included the notice fixes again. Same patch as #2 with only relevant changes.
Comment #4
toemaz commentedApplied to 6.x-1.x-dev.
Question: for developers already using this module, do they need to empty cache so the menu is rebuild? If so, how do we trigger this when they update the module?
Comment #5
quicksketchI don't think that this accidental implementation of hook_node_access() actually caused much harm, since it always bailed out pretty quickly and didn't return anything. However if you'd like to force a cache clear you can make an update hook that doesn't contain anything other than drupal_flush_all_caches();
Comment #6
yang_yi_cn commentedcommitted, with drupal_flush_all_caches() in .install file.