DevelController.php
DevelController::session() contains a theme() function that causes a function not found error on the session page ( "\devel\session" ) of the module when the module is included in Drupal 8 Beta 2. It looks to me like someone left the theme() function there because they wanted to implement fancy table formatting. But the kprint_r() function already prints out the $_SESSION array data. And you could supply session_name() and session_id() without the formatting, although I don't really know how any of this information is even especially useful
public function session() { $output = kprint_r($_SESSION, TRUE); $headers = array(t('Session name'), t('Session ID')); // @todo don't call theme() directly. $output .= theme('table', array('headers' => $headers, 'rows' => array(array(session_name(), session_id())))); // <== ERROR HERE return $output; }
So I would suggest:
public function session() { $output = 'Session Name: ' . session_name() . '
'; $output .= 'Session ID: ' . session_id() . '
'; $output .= '' . t('Here are the contents of your
'; $output .= kprint_r($_SESSION, TRUE); return $output; }$_SESSION
variable.') . '
Also, in conjunction with this, the devel_help() hook function in "devel.module" can be deleted, since the routing is now taken care of by the devel.routing.yml file configuration.
Comment | File | Size | Author |
---|---|---|---|
#2 | devel-develcontroller-session-2367399-2.patch | 1.57 KB | willzyx |
devel_module-fix-session-method.patch | 900 bytes | pkosenko | |
Comments
Comment #1
pcambraComment #2
willzyx CreditAttribution: willzyx commentedComment #3
pcambraThanks, pushed to the 8.x version