Skip to content

Commit

Permalink
- Fix new core won't load Bonfire controllers
Browse files Browse the repository at this point in the history
- Fix migrate v44
- Fix admin header profile link
  • Loading branch information
Le Sy Dat committed Apr 3, 2017
1 parent 65a942a commit c341a1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bonfire/ci3/core/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,17 @@ function &get_instance()
$class = ucfirst($RTR->class);
$method = $RTR->method;

if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
if (empty($class) OR (! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php') AND ! file_exists(BFPATH.'controllers/'.$RTR->directory.$class.'.php')))
{
$e404 = TRUE;
}
else
{
require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
if (file_exists(APPPATH . 'controllers/' . $RTR->directory . $class . '.php')) {
require_once(APPPATH . 'controllers/' . $RTR->directory . $class . '.php');
} elseif (file_exists(BFPATH . 'controllers/' . $RTR->directory . $class . '.php')) {
require_once(BFPATH . 'controllers/' . $RTR->directory . $class . '.php');
}

if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
{
Expand Down
10 changes: 9 additions & 1 deletion bonfire/migrations/044_Update_ci3_sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ class Migration_Update_ci3_sessions extends Migration
*/
public function up()
{
$this->db->query("ALTER TABLE ci3_sessions CHANGE id id varchar(128) NOT NULL;");
$fields = array(
'id' => array(
'type' => 'varchar',
'constraint' => 128,
'null' => false,
)
);

$this->dbforge->modify_column('ci3_sessions', $fields);

// For Postgres, use this instead...
// $this->db->query("ALTER TABLE ci3_sessions ALTER COLUMN id SET DATA TYPE varchar(128);");
Expand Down
2 changes: 1 addition & 1 deletion public/themes/admin/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<!-- User Menu -->
<div class="nav pull-right" id="user-menu">
<div class="btn-group">
<a href="<?php echo site_url(SITE_AREA . '/settings/users/edit'); ?>" id="tb_email" class="btn dark" title="<?php echo lang('bf_user_settings'); ?>">
<a href="<?php echo site_url('users/profile'); ?>" id="tb_email" class="btn dark" title="<?php echo lang('bf_user_settings'); ?>">
<?php
$userDisplayName = isset($current_user->display_name) && ! empty($current_user->display_name) ? $current_user->display_name : ($this->settings_lib->item('auth.use_usernames') ? $current_user->username : $current_user->email);
echo $userDisplayName;
Expand Down

0 comments on commit c341a1d

Please sign in to comment.