In the implementation of hook_menu, the menu item for the admin/reports/apachesolr looks like this:
$env_id = apachesolr_default_environment();
$items['admin/reports/apachesolr'] = array(
'title' => 'Apache Solr search index',
'description' => 'Information about the contents of the index the server',
'page callback' => 'apachesolr_index_report',
'page arguments' => array($env_id),
'access arguments' => array('access site reports'),
'file' => 'apachesolr.admin.inc',
);
which means that the $env_id is kinda hard-coded to the default solr env at the time menu cache was flushed. If the default env is changed, this page will still display data of the previous default env until the menu cache is flushed again.
And there is no way to display data from the other (non-default) environments.
I think this URL should make use of an argument from the URL. And fall-back to the default env inside the page callback, to make sure that the correct default env is used.
Comments
Comment #1
khaled.zaidan commentedHere's quick patch to fix this, there might still be room for improvement, but at least here's something that works:
Comment #2
khaled.zaidan commentedIt might be cool also, in the top of the page, to add a link for each of the currently available environments. That way you can easily view the details of each environment without having to type its machine name in the URL.
Comment #3
nick_vhThis is indeed something we should improve and we did not expect that the different environments would be picked up so quickly
I'll take a look at you patch during the Drupal Dev Days! Feel free to keep improving your patch over the next coming hours/days.
If you go to the environments page, you can already click on index and it will take you to a page with information about that environment. The basic front page is meant to only show the default one. We should do something similar for the reports I think?
Comment #4
nick_vhFeature request, let's get to RC1 first
Comment #5
pwolanin commentedRight, we should fix the hook menu bug - I don't think the approach here is optimal.
Comment #6
khaled.zaidan commentedHi Nick,
My main concern is the bug in hook_menu. Sure the suggested feature of having a link for each environment is an extra featured, and can definitely wait.
But the main issue itself (having the default environment fused into the menu item definition) is a bug, not a feature request. I think it is important and simple to fix.
(Changing category back to 'bug report')
Comment #7
pwolanin commentedYes, this is a bug as currently coded.
Comment #8
nick_vhThis should vastly improve the current problem. We might even want to add a stats link in the environment list?
Comment #9
nick_vhShould be better, file paths were broken
Comment #10
nick_vhpushed to 7.x-1.x
Thanks for the input!
Comment #11
killua99 commentedBackport for 6.x-3.x
Comment #12
nick_vhComment #13
nick_vhcommitted to 6.x-3.x, had to make some small adjustments
Comment #14
killua99 commentedOh I see, that changes ... mmm I did not notice that tables ... nice.
Comment #15
nick_vh