Skip to content

Admin area is unavailable for users without podcast / actor linked to them

Describe the bug

When a user tries to login in the admin area without having a podcast / actor, a message error prevents them from doing anything.

Steps to reproduce

  1. Connect as a superadmin
  2. Create at least one podcast
  3. Create a new user with superadmin priviledges
  4. Connect with the new user
  5. See error.

Expected behavior

The new user should be able to access the admin area.

Relevant logs and/or screenshots

CRITICAL - 2022-03-07 10:14:21 --> Attempt to read property "avatar_image_url" on bool
#0 /castopod/themes/cp_admin/_partials/_nav_header.php(28): CodeIgniter\Debug\Exceptions->errorHandler()
#1 /castopod/app/Libraries/View.php(90): include('...')
#2 /castopod/app/Libraries/View.php(93): App\Libraries\View->App\Libraries\{closure}()
#3 /castopod/vendor/codeigniter4/framework/system/View/View.php(424): App\Libraries\View->render()
#4 /castopod/themes/cp_admin/_layout.php(27): CodeIgniter\View\View->include()
#5 /castopod/app/Libraries/View.php(90): include('...')
#6 /castopod/app/Libraries/View.php(93): App\Libraries\View->App\Libraries\{closure}()
#7 /castopod/app/Libraries/View.php(106): App\Libraries\View->render()
#8 /castopod/app/Common.php(44): App\Libraries\View->render()
#9 /castopod/modules/Admin/Controllers/PodcastController.php(57): view()
#10 /castopod/modules/Admin/Controllers/PodcastController.php(32): Modules\Admin\Controllers\PodcastController->list()
#11 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(830): Modules\Admin\Controllers\PodcastController->_remap()
#12 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(419): CodeIgniter\CodeIgniter->runController()
#13 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(326): CodeIgniter\CodeIgniter->handleRequest()
#14 /castopod/public/index.php(41): CodeIgniter\CodeIgniter->run()
#15 {main}

Context

  • Castopod: v1.0.0-beta.9
  • OS: Ubuntu server 20.04
  • Browser: any
  • Web server: Nginx

Possible fixes

Check if user_can_interact before displaying any actor avatar.