Can't add or make changes to users

Posted In Wave
  • thomas 2 months ago
    With a fresh installation of Wave I'm having many issues, I figure I'll tackle one at a time, and this one makes everything unusable.
    
    If I try to add or edit a user, when I click save I get the follow error associated with the setSettingsAttribute function shown below.  Any help would be appreciated.  Feeling a little ripped off for my $60 right now, this is the main reason I subscribed.
    
    	.../Sites/wave/vendor/tcg/voyager/src/Models/User.php
    	{
        use VoyagerUser;
     
        public function setSettingsAttribute($value)
        {
            $this->attributes['settings'] = $value->toJson();
        }
    		
    Error message is:
    
    	Call to a member function toJson() on null
    		

    With a fresh installation of Wave I'm having many issues, I figure I'll tackle one at a time, and this one makes everything unusable.

    If I try to add or edit a user, when I click save I get the follow error associated with the setSettingsAttribute function shown below. Any help would be appreciated. Feeling a little ripped off for my $60 right now, this is the main reason I subscribed.

    .../Sites/wave/vendor/tcg/voyager/src/Models/User.php
    {
    use VoyagerUser;
    
    public function setSettingsAttribute($value)
    {
        $this->attributes['settings'] = $value->toJson();
    }
    	
    

    Error message is:

    Call to a member function toJson() on null
    	
    
  • tnylea 2 months ago
    Hey Thomas, 
    
    Can you try and replace the function with this and let me know if it works?
    
    ```
    use VoyagerUser;
    
    public function setSettingsAttribute($value)
    {
    	  if(isset($value)){
            $this->attributes['settings'] = $value->toJson();
    	 }
    	 $this->attributes['settings'] = $value;
    }
    ```
    
    Additionally, I'll try and replicate this with a fresh installation to see what's going on. Thanks!

    Hey Thomas,

    Can you try and replace the function with this and let me know if it works?

    use VoyagerUser;
    
    public function setSettingsAttribute($value)
    {
    	  if(isset($value)){
            $this->attributes['settings'] = $value->toJson();
    	 }
    	 $this->attributes['settings'] = $value;
    }
    

    Additionally, I'll try and replicate this with a fresh installation to see what's going on. Thanks!

  • gurkin-banjo 1 month ago
    Hi - Just to say that I have a new install as well, and the dashboard user functionality isn't working at all.  No list, add, delete etc....
    
    The error is 
    
    local.ERROR: get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) {"userId":1,"exception":"[object] (ErrorException(code: 0): get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4, ErrorException(code: 0): get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4, ErrorException(code: 0): get_class() expects parameter 1 to be object, string given at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4)

    Hi - Just to say that I have a new install as well, and the dashboard user functionality isn't working at all. No list, add, delete etc....

    The error is

    local.ERROR: get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) {"userId":1,"exception":"[object] (ErrorException(code: 0): get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4, ErrorException(code: 0): get_class() expects parameter 1 to be object, string given (View: /var/www/html/bizportalwave/vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php) at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4, ErrorException(code: 0): get_class() expects parameter 1 to be object, string given at /var/www/html/bizportalwave/storage/framework/views/36a63cd0fb61148e4928f50c04da21770a1c03ad.php:4)

  • thomas 1 month ago
    Thanks @tnylea, for some reason I didn't get an email for this response.  I found some fixes online:
    
    added the following code in App\User
    
    ```
    public function setSettingsAttribute($value) { 
    		$this->attributes['settings'] = $value ? $value->toJson() : null; 
    		}
    ```
    And in /admin/bread/users/edit (Users BREAD) changed Model name: App\User

    Thanks @tnylea, for some reason I didn't get an email for this response. I found some fixes online:

    added the following code in App\User

    public function setSettingsAttribute($value) { 
    		$this->attributes['settings'] = $value ? $value->toJson() : null; 
    		}
    

    And in /admin/bread/users/edit (Users BREAD) changed Model name: App\User

Please login or signup to leave a response.

Login

or Sign Up

Sign Up

or Login
×
Want to create your own SAAS?

I can teach you to create your own Software as a Service. Click here to learn more!

Visit SAAS Adventure!