Skip to content

Instantly share code, notes, and snippets.

@sdboyer
Created May 18, 2013 23:07
Show Gist options
  • Select an option

  • Save sdboyer/5606040 to your computer and use it in GitHub Desktop.

Select an option

Save sdboyer/5606040 to your computer and use it in GitHub Desktop.
rough assessment of the blocks we have that break data encapsulation
- BookNavigationBlock
- menu_get_object() called from build, in search of a node
- book_get_books() called, if in "all pages" mode, to search out book/current page associations
- lots of menu_tree_output(), etc., called, which relies on current path info
- ActiveTopicsBlock and NewTopicsBlock
- not breaking data encapsulation, but calls drupal_render_cache_by_query()
- LanguageBlock
- menu_is_front_page()/current_path()
- ShortcutsBlock
- calls shortcut_current_displayed_set() without args, so is inherently reliant on global $user
- also calls shortcut_renderable_links(), which consults menu_tree(). this is probably not so bad
- SystemHelpBlock
- menu_get_active_help() is called, which relies on pathing info.
- SystemMainBlock
- this is its whole own rat's nest of problems
- SystemMenuBlock
- relies on menu_tree(), which relies on global locative info from current_path()
- UserLoginBlock
- access relies on global user. this is actually probably correct
- calls current_path() and drupal_get_destination() in order to set the form redirection correctly. this will be a general problem with forms.
- ViewsBlock
- kinda iffy, i'm guessing that this gets its args from the wrapping entity in a kinda ugly way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment