Topic by Ramy NATOUR
Content
Hello everyone,
I'm currently facing a strange behaviour on both Knowledge Foundation API and Connect PHP API : Values returned by GetSmartAssistantSearch/SearchContent/Fetch are Objects containing only null fields.
Here is a var_dump of a fetched account for example :
["Account"]=> object(RightNow\Connect\v1_2\Account)#22 (25) { ["ID"]=> NULL ["LookupName"]=> NULL ["CreatedTime"]=> NULL /* [...] */ ["PasswordExpirationTime"]=> NULL ["Phones"]=> NULL ["Profile"]=> NULL ["SalesSettings"]=> NULL ["ServiceSettings"]=> NULL ["Signature"]=> NULL ["StaffGroup"]=> NULL } |
This behaviour seems strange to me because :
- I called the InitConnectAPI() function after importing connect_init.phph file. I tried with both no args and with username + password
- In case I give an incorrect account ID to the RNCPHP\Contact::fetch() function, it returns an error . Assuming this, he manages to find the searched contact when i supply the good ID but all its fields are NULL.
- Not a single Exception is thrown nor a single error occurs (E_ALL is on)
- All the needed permissions for the profile's account used are set to true
- Getting those objects via ROQL(Object Explorer or Soap) returns the correct object with the correct values in the fields
The above example treats only of the Connect PHP API behavior but I have more or less the same issue on the Knowledge Foundation API described in this post.
Error(!= Warning) on the read-only init.php file:
A call to the error_get_last() function after the fetches says that there is an error in the init.php read-only core's file :
Array ( [type] => 8 [message] => Undefined index: REDIRECT_URL [file] => /cgi-bin/siebeltocloud_fr.cfg/scripts/cp/core/framework/3.2.4/init.php [line] => 246 )
Questions:
Assuming this issue touches both the Knowledge Foundation API and the Connect PHP API and behaves in a very close way:
- Am I missing a configuration/initialization step (giving the permissions to the account used, calling InitConnectAPI(acc_usr, acc_pwd) )?
- After finding the fetched contact, what step in the fields population could go wrong ?
- Is the error coming from the init.php file the cause of this issue ? If yes, how can this issue be solved since the file is read-only and in the core (which I don't want to edit) ?
- Is the field populating function from the Knowledge API and Connect PHP API the same ? How could it fail and what can be done to solve this ?
If anyone has faced the same issue, giving a workaround/clues to solve it would be very kind.
Thanks in advance,
Have a nice day.
Edit:
- Tried using the function RNCPHP\ROQL::queryObject() and getting an empty result set as well