Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. diff --git a/boxes.module b/boxes.module
  2. index 0474e3d..3249b92 100644
  3. --- a/boxes.module
  4. +++ b/boxes.module
  5. @@ -104,7 +104,8 @@ function boxes_block_info() {
  6. // Let context group the instances together
  7. $blocks[$box->delta]['context_group'] = t('Boxes for @plugin', array('@plugin' => $plugins[$box->plugin_key]['title']));
  8. // Let each box determine how it is cached
  9. - $blocks[$box->delta]['cache'] = $box->cache_setting();
  10. + // @todo COMMENTED OUT TMP 5/29 throwing fatal error -RWB
  11. + //// $blocks[$box->delta]['cache'] = $box->cache_setting();
  12. }
  13.  
  14. // 'Add' blocks for editing a page inline
  15. @@ -373,17 +374,38 @@ function boxes_box_load($delta = NULL) {
  16. if (isset($delta)) {
  17. $box = boxes_box::load($delta);
  18. drupal_alter('boxes_box_load', $box, $delta);
  19. - return $box;
  20. + if ($box instanceof boxes_box) {
  21. + return $box;
  22. + }
  23. + return false;
  24. }
  25. ctools_include('export');
  26. $boxes = array();
  27. foreach (ctools_export_load_object('box') as $box) {
  28. $box = boxes_box::load($box->delta);
  29. if ($box) {
  30. - drupal_alter('boxes_box_load', $box, $delta);
  31. - $boxes[$box->delta] = $box;
  32. + if ($box instanceof boxes_box) {
  33. + drupal_alter('boxes_box_load', $box, $box->delta);
  34. + $boxes[$box->delta] = $box;
  35. + }
  36. + }
  37. + if (module_exists('spaces') && $space = spaces_get_space()) {
  38. + foreach ($space->controllers->boxes->get() as $space_box) {
  39. + // Some older overrides may be stored as an array, check for these and convert them to objects.
  40. + if (is_array($space_box)) {
  41. + $space_box = (object)$space_box;
  42. + }
  43. + $box = boxes_factory($space_box->plugin_key, $space_box);
  44. + $box->new = FALSE;
  45. +
  46. + if ($box instanceof boxes_box) {
  47. + drupal_alter('boxes_load', $box, $box->delta);
  48. + $boxes[$box->delta] = $box;
  49. + }
  50. + }
  51. }
  52. }
  53. +
  54. return $boxes;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement