Hi,
A few weeks ago, I created a trigger in my Dolibarr to create a folder in my Google Drive when I created a project.
If the array_option[“adress_google_drive”] of the project was empty, I used the google service api to create a folder with the project name. And the adress of the folder was going to the array_option[“adress_google_drive”].
In this way, when we modified the project in Dolibarr, the array_option[“adress_google_drive”] was full with the creation of the project, so the google service api did nothing.
It was working very well.
But now, the running is very weird …
On an old project, the google servce api was not used, so it was created without a google drive folder. So the array_option[“adress_google_drive”] was empty.
Normally, the trigger see that, and it created automatically a google drive folder and paste the adress ine the array_option.
But now, the trigger create a google drive folder successfully according the name of the old project, keep the address of the folder in memory (I see that with var_dump), but doesn’t copy it in array_option !!
Here’s a piece of code :
$object->array_options['adress_google_drive'] = $this->createFolder($object->ref.'_'.$object->title, $this->serviceClientGoogle, 'adress_of_a_google_drive_folder'); //createFolder is the function to create the folder
var_dump($object->array_options[‘adress_google_drive’]) and the id of the new folder on google drive is exactly the same.
But, when the dolibarr’s webpage is refreshed, the input is empty !!!
What is the problem ?
Thanks a lot for any kind of help !