Add new block to dashboard trigger page redirect/reload

Created on 22 June 2012, over 12 years ago
Updated 21 February 2023, almost 2 years ago

I try show homebox for user on custom block. This is easy:


function mymodule_block_info() {
  $blocks = array();

  $blocks['mymodule-dashboard-block'] = array(
    'info' => t('MYMODULE USER: User dashboard block'),
    'cache' => DRUPAL_NO_CACHE,
  );

  return $blocks;
}

function mymodule_block_view($delta = '') {
  $block = array();

  switch ($delta) {
    case 'mymodule-dashboard-block':
      $block['subject'] = NULL;
      $block['content'] = array(
        '#markup' => mymodule_dashboard_block(),
      );
      break;
  }

  return $block;
}

function mymodule_dashboard_block() {
  $page = homebox_get_page('user_dashboard');
  return homebox_build($page);
}

But if i want ad new block to user dashboard, current page is always reload and redirect to user-dashboard page. If there other homebox tasks done by AJAX (order blocks, delete blocks) why add blocks not? I'm look at funcionality for adding new block and on the end of function function homebox_add_block() i see drupal_goto(homebox_get_path($page)).

Is there any way how to alter current $page path? I think AJAX saving and refreshing block would be better solution for this problem.

✨ Feature request
Status

Closed: won't fix

Component

User interface

Created by

πŸ‡ΈπŸ‡°Slovakia havran

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Please create a new Drupal 8+ (3.0.x) issue, referencing this one, if this is still relevant for Drupal 8+ (3.0.x).

    As this issue was created for Drupal 7 which is close to EOL and won't receive any new features here anymore (unless someone implements them or sponsors development) I'm closing this issue for cleanup now.

    If anyone works on this or has a solution, feel free to reopen! :)
    Thank you.

Production build 0.71.5 2024