-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing nested values in import is non-ideal #2474
Comments
Upon further review, I realize that neither of my proposed fixes above would work, as the value access is attempted before any import source modifiers are applied. I've submitted a PR with the simplest fix first: simply return null if the value is not a nested object. Another idea I have to fix this: |
I submitted a second PR for my second fix option: #2585 |
@icanhazpython: I have no better solution right now, this would require a new config flag at sync property level. Please have a look at the Combine Property Modifier, it should provide what your second pull request does |
Didn't like the idea of having a flag for this. I changed the default behavior, so for your use-case it should behave as expected out of the box. The following variants are now possible when accessing
|
So I am importing via a JSON source. For some record "columns", nested objects are returned and I can access them within the import source and sync rule with dot-notation. Great! However, with my import source, these items can occasionally come back without any object at all, or as null. When this occurs, the below-linked error is triggered. I can't seem to figure a way around this other than building a custom importer. I feel that it would be more beneficial to the community however if this functionality was "fixed" so that it handled this situation more gracefully. Here are two possible proposals for fixing this:
I think either of the above options (or even both!) would really benefit other users. If there is some other workaround or option I missed, please let me know!
icingaweb2-module-director/library/Director/Import/SyncUtils.php
Line 97 in 302c9b6
The text was updated successfully, but these errors were encountered: