Open flavius-constantin opened 6 months ago
The "funny" thing is, that it works on my machine but not on the live Server (Cloud Server, hosted by Hetzner). I use Herd for local development.
I've also created a ZohoAuthenticable File to combine the default Authenticable with Zohoable on the User Model. This is the code:
<?php
namespace App\Traits;
use Asciisd\Zoho\Contracts\Repositories\ZohoableRepository;
use Asciisd\Zoho\Traits\Zohoable as ZohoableModel;
use Asciisd\Zoho\ZohoManager;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\MustVerifyEmail;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\Access\Authorizable;
abstract class ZohoAuthenticable extends Model implements
ZohoableRepository,
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use ZohoableModel, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail;
protected string $zoho_module_name;
protected ZohoManager $zoho_module;
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->zoho_module = $this->getZohoModule();
}
}
This is how the method searchCriteria() looks like:
And this is the method zohoMandatoryFields():
Ok, look, you can get more detailed logs from storage/app/zoho/oauth/logs/ZCRMClientLibrary.log
Same error like in my second image when I've tried to give it a shot through Tinkerwell. Caused by a TYPE ERROR. But, WHY? And what should I do now? As I've mentioned above, it works on my local machine (Laravel Herd) but not on the Live Server hosted by Hetzner.
The Error is clear I think, thank you. But it is very interesting, why it is working on my local machine. I've tried it many times locally and it does what it should. After I've uploaded it to the live server, nothing works. -_-
2024-05-01 10:23:00 com\zoho\api\logger\SDKLogger SEVERE Exception in forming request body : com\zoho\crm\api\exception\SDKException Caused by : TYPE ERROR - {"field":"leadSource","class":"com\\zoho\\crm\\api\\record\\Record","index":0,"expected-type":"com\\zoho\\crm\\api\\util\\Choice","given-type":"string"}
/home/ploi/d724.de/vendor/zohocrm/php-sdk-6.0/src/com/zoho/crm/api/util/Converter.php- 193-
2024-05-01 10:27:52 com\zoho\api\logger\SDKLogger SEVERE Exception in forming request body : com\zoho\crm\api\exception\SDKException Caused by : TYPE ERROR - {"field":"leadStatus","class":"com\\zoho\\crm\\api\\record\\Record","index":0,"expected-type":"com\\zoho\\crm\\api\\util\\Choice","given-type":"string"}
/home/ploi/d724.de/vendor/zohocrm/php-sdk-6.0/src/com/zoho/crm/api/util/Converter.php- 193-
I don’t know exactly what is happening in the live server, but I guess it could be the PHP version may led to the issue
Just changing the type of lead source and lead status to Choice instead of string should fix the issue
Hey
This is the error i got, when I try to create a User and after that, to run ->createAsZohoable
I've tried to do the same thing with Tinkerwell and this is the error I became:
It doesn't matter if I run createAsZohoable() with or without options. The error is still the same.
Here are my Settings out of the .env file:
Please HELP! Thanks!