By ryan.armstrong on
I am trying to build a tableselect of users on a page I have. So I copied the code from user.admin.inc that generates the 'People' admin page, since that is exactly what I need (I will eventually add some different filters etc), but no matter what I try I only get the empty text I've specified for the tableselect. I have dpm()'ed the $options variable on my page and on the 'People' page and they are identical and full with users. I cannot figure out what I am doing wrong. Code here: http://pastebin.com/2jGVNxG9
The function ds_employees() is being called by my hook_menu() implimentation as such:
$items['manage/employees'] = array(
'title' => 'Employees',
'description' => t('Manage your employees, survey them, and add new employees your team'),
'page callback' => 'ds_employees',
'access arguments' => array('access employees page'),
'expanded' => TRUE,
'menu_name' => 'main-menu',
'weight' => 1,
);
Comments
I am probably not the one
I am probably not the one that should be commenting on this for I am new to php and I am not using drupal 7. With that being said should it not be:
dsm($whatever);and not
dpm($whatever);In Drupal 7 (maybe earlier)
In Drupal 7 (maybe earlier) dsm() is depreciated and in fact simply calls dpm().
Ryan Armstrong
Senior Software Architect
NVIDIA
I figured it out. The problem
I figured it out. The problem wasn't in my form function, it was in my hook_menu. For reference, if you are calling a form function rather then just a page callback, the hook_menu() bit is a bit different. You need to have these in your $items array:
Ryan Armstrong
Senior Software Architect
NVIDIA
I didn't look at your
I didn't look at your external code, but maybe this can help: http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-...
Contact me to contract me for D7 -> D10/11 migrations.
Thanks for the link, I'll
Thanks for the link, I'll give that a run, perhaps it is because I am using form API elements in a page callback. The od thing is that the form element shows up just fine, it's just that it's not displaying the data.
Ryan Armstrong
Senior Software Architect
NVIDIA
Yea the code I have is pretty
Yea the code I have is pretty much identical to that tutorial. What is weird is that just a bit ago it started working, but as soon as I cleared the cache, it stopped.
Ryan Armstrong
Senior Software Architect
NVIDIA