Hey guys,

I enabled it, I configured the blocks to be shown, but when I go to http://www.example.com/user/uid/dashboard all I get is the My account page.

How can I get it to show what I just configured? or better said, how can I get it to show at all?

Thanks,

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jfha73’s picture

Component: Documentation » Code
Category: support » bug
Priority: Normal » Critical

OK, I finally found how to get it to show, but now after adding widgets I try to have a user to show this widgets to his dashboard, when he clicks on More widgets, he gets this:

warning: Invalid argument supplied for foreach() in /sites/default/modules/dashboard/templates/dashboard-browse-widgets.tpl.php on line 3.

Any idea what can be causing this?

jfha73’s picture

Title: How do I get it to show? » Getting nothing
Version: 6.x-2.1 » 6.x-2.x-dev

OK, this is what I have done so far.

I uninstalled v2.1 and installed 2.x-dev, that got rid of the error, but now when I visit www.example.com/dashboard all I see is an empty box, not the widgets I configured to show, also, when I go to More widgets, it's empty, any ideas what I might be doing wrong?

glance’s picture

Hi,

Can you tell me how did you manage to show things on xxx/user/uid/dashboard

I am facing the same problem here.

Thanks.

jfha73’s picture

I managed to show the dashboard just by logging in and going to www.domain.com/dashboard, but I still don't get what I have configured for the widgets.

In other words, the path to the dashboard is the one above, but in my case it still doesn't show anything.

codekarate’s picture

Are you able to add widgets using the widgets tab on the dashboard page? You should be able to click on that tab and add some widgets to your dashboard. If you can not see the widgets in the widgets tab then take a look at http://drupal.org/node/869016 because it may be a similar issue. In my case I had to clear the theme registry to get the widgets to show up.

jfha73’s picture

No, that doesn't work for me either, I will try what they suggest there (clear the cache 3 times) :)

jfha73’s picture

I cleared the cache but all I see is the recent posts in Dashboard, when I click to add widgets, nothing happens, all I get is a page with no widgets.

codekarate’s picture

Clearing the cache in itself does not seem to work, you need to clear the theme registry specifically. This can be done using the Admin menu module or Drush.

If you download the admin menu module, you can clear the "theme registry" while you are on the blank "add widgets" page and it will work. Or if you are using a theme that allows you to rebuild the theme registry on every page load, you can enable that and it will always work. However, it would not be a good idea to have the theme registry rebuilt on a production site as it severely hurts performance.

I am still planning on looking into this more to try to figure out the underlying caching issues, I just have not had the time yet.

jfha73’s picture

I'm using a test site with everything the same as the live site so I can test, I downloaded the admin module, but I could not find anything that allows me to clear the registry cache of the theme, so I guess the theme doesn't have that option, I also downloaded Drush, but I have no idea what to do with this, so I have not test it yet.

If you have information on how to clear this registry using Drush or even using phpMyAdmin I'd appreciate it.

Let us know when you have fixed this problem, in my case I'd love to see it working in my site and I bet my users will love it.

codekarate’s picture

I have been waiting to see if the maintainer would have an easy fix for this but it seems like he hasn't checked up on this in quite some time. I plan on looking at this either today or tomorrow because I need it fixed as well. I will try to find a fix and post a patch here if I am able to figure out the issue.

codekarate’s picture

Ok I finally took the plunge and sat down to figure out this bug. It seems to be something really weird that is going on with the template_preprocess_dashboard_widget_browser not being called when you go to the dashboard/widgets page. For some reason if you clear the theme registry right before the page load it will call that function but not under normal circumstances.

I honestly can not figure out why this function is not being called as it should be called every time based on the hook_theme documentation and template_preprocess documentation that I have been looking over. I am not sure if this is some weird bug in the dashboard module or perhaps something in core.

Either way I found a very easy workaround by explicitly telling the module to call the function in the hook_theme implementation. I would be interested to know what the root cause of this issue really is, if there is someone with more Drupal theming knowledge that knows the intricacies of preprocessing functions, they may be able to more easily find the root cause of this bug... until then, here is the handy workaround patch that should do the trick.

Let me know if it works.

jfha73’s picture

I guess I'm going to have to wait for the next release of this module because I don't have shell access in the server where I have my test site.

Can this be included in the dev version of the module?

codekarate’s picture

Since I am not the maintainer I can't add it to the dev version of the module. You should be able to pull the module down on your local system, run the patch, and then upload it to the site. If you can't, I can probably send you the patched version (it would be nice for me to have some others test it to make sure the patch works outside my test environment).

Otherwise, the patch is only a one line change, just open up the dashboard.module file and add a line of code after line 238. Just change:

'dashboard_widget_browser' => array(
   'path' => $path,
   'template' => 'dashboard-browse-widgets',
),

To:

'dashboard_widget_browser' => array(
  'path' => $path,
  'template' => 'dashboard-browse-widgets',
  'preprocess functions' => array('template_preprocess_dashboard_widget_browser'),
),

You should then be able to upload that to your site.

broncomania’s picture

Thx for this post in combination with my post here http://drupal.org/node/1036994 everything works now. I think it's time for the next dev update. These both fixes are really nessesary to get the dashboard module run.

jfha73’s picture

OK, with these updates I can see the blocks I made available in the more widgets page, but I still can't get them to be seen in the actual dashboard.

Am I forgetting something here?

codekarate’s picture

I would make sure to clear the cache just to make sure. Then try to go back to the widgets page and re-add some items. If it still does not work, then make sure you have the jquery_ui module installed correctly. When installing the jquery_ui module you need to add the jquery_ui library. There is information on how to install it in the README file inside the jquery_ui module.

jfha73’s picture

I cleared the cache, verified jquery library and everything is in place, I even tried uninstalling both modules (Dashboard and jquery) but I still don't get my blocks to show in the Dashboard page, they do show in the widgets area, but I don't get anything to select to make them appear in the Dashboard page.

Again, I might be missing something, can somebody tell me the steps I need to follow to get ir up and running from the beginning so I can check I did everything the right way?

Thanks in advance.

codekarate’s picture

It appears you are correct, my fix displays the dashboard widgets but for some reason does not display the link to add them to your dashboard. This still appears to be a theme registry or caching issue. I will be looking into it more today.

codekarate’s picture

Ok, again its the same issue as before but with a different theme function. Here is the quick change to the code, after I confirm that this is the last issue I will upload a new patch file with both of these changes.

Change dashboard.module around line 240 from:

'dashboard_display_widget' => array(
  'path' => $path,
  'template' => 'dashboard-display-widget',
  'arguments' => array(
    'widget' => array(),
  ),
),

To:

'dashboard_display_widget' => array(
  'path' => $path,
  'template' => 'dashboard-display-widget',
  'arguments' => array(
    'widget' => array(),
  ),
  'preprocess functions' => array('template_preprocess_dashboard_display_widget'),
),

Just adding the preprocess function piece. Still not sure why it is necessary, but it appear to work.

codekarate’s picture

Here is the patch.

jfha73’s picture

Now I see the Add to dashboard link, at least from my side, it's confirmed it works.

chiragjain’s picture

How to install the patch

codekarate’s picture

plopesc’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)