-
Notifications
You must be signed in to change notification settings - Fork 8
Bug with fieldList method dealing with custom fields. #12
Comments
I feel like this will break if another field is added though... |
Changing my if statement to this will probably prevent it from breaking, and allow it to run the existing code if a valid
|
But here's my opinion :)
|
Thanks for getting back to me. I had a feeling you might not be working on this anymore. I'll probably have to do a fork since modifying files in vendor is really poor form and risky. I guess you're right I'm manually doing the work array_column() is doing essentially, I should be able to cast it accordingly and pass it to the existing array_column() call. I'll implement something better and you're right about skipping the resource check. I have to add another custom field today so I'll see if the array is returned from the api now. |
I'm not sure if this is a problem because of the way the API returns objects when there is only one instance of said object type but I ran into this and I only have 1 custom field defined. I did not try the existing code with multiple fields but I did come up with a fix / workaround for this.
I really dont have time to do a PR and I'm also not sure if this is the best way to fix this however in CRM.php at Line 162 you have the following code:
The problem here is that in my particular instance the
$list
variable was of typeProsperWorks\Resrouces\BareResource
and notArray
as expected by the call toarray_column
within this block.I was able to fix / work around this by changing the above block to this:
What do you think?
The text was updated successfully, but these errors were encountered: