-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adding a raw value function to return value from values array #465
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Any update on this, I want to deploy this change on production. Thanks, |
This does no harm, will merge this. |
puresyntax71
added a commit
to puresyntax71/civicrm_entity
that referenced
this pull request
Apr 19, 2024
* origin/4.0.x: 4.0.x field mappings (eileenmcnaughton#430) Adding a raw value function to return value from values array (eileenmcnaughton#465) Add filter for state province. (eileenmcnaughton#453) Update default timezone handling for dates in CiviEntityStorage.php (eileenmcnaughton#461) fix testLoadContact birthdate assertion (eileenmcnaughton#472) port to 4.0.x from 436: Include dblocale table names in list of civicrm entity info (eileenmcnaughton#438) Ignore convert to UTC if custom field is date only (eileenmcnaughton#469) update contact entity referece field on contact merge (eileenmcnaughton#456) update test versions of Drupal 10.2 and CiviCRM 5.69 (eileenmcnaughton#468) Clean value on custom field for Float (Number) and Money field type (eileenmcnaughton#463) From eileenmcnaughton#378 for 4.0.x (eileenmcnaughton#466) Add reset to the file URLs generated. (eileenmcnaughton#458) fix Views field custom date field output for year only (eileenmcnaughton#439)
puresyntax71
added a commit
to puresyntax71/civicrm_entity
that referenced
this pull request
Apr 27, 2024
* origin/4.0.x: (41 commits) patch from issue 3420771 (eileenmcnaughton#475) only check for data in enabled components on module uninstall (eileenmcnaughton#476) Adds is Empty/NULL operators (eileenmcnaughton#423) Pathauto (eileenmcnaughton#470) fix test to use string instead of integer for zip code (eileenmcnaughton#474) 4.0.x field mappings (eileenmcnaughton#430) Adding a raw value function to return value from values array (eileenmcnaughton#465) Add filter for state province. (eileenmcnaughton#453) Update default timezone handling for dates in CiviEntityStorage.php (eileenmcnaughton#461) fix testLoadContact birthdate assertion (eileenmcnaughton#472) port to 4.0.x from 436: Include dblocale table names in list of civicrm entity info (eileenmcnaughton#438) Ignore convert to UTC if custom field is date only (eileenmcnaughton#469) update contact entity referece field on contact merge (eileenmcnaughton#456) update test versions of Drupal 10.2 and CiviCRM 5.69 (eileenmcnaughton#468) Clean value on custom field for Float (Number) and Money field type (eileenmcnaughton#463) From eileenmcnaughton#378 for 4.0.x (eileenmcnaughton#466) Add reset to the file URLs generated. (eileenmcnaughton#458) fix Views field custom date field output for year only (eileenmcnaughton#439) update Add Contact to Group Views Bulk operations action plugin access handler (eileenmcnaughton#464) Readme update (eileenmcnaughton#457) ...
puresyntax71
added a commit
to puresyntax71/civicrm_entity
that referenced
this pull request
Apr 30, 2024
* origin/4.0.x: patch from issue 3420771 (eileenmcnaughton#475) only check for data in enabled components on module uninstall (eileenmcnaughton#476) Adds is Empty/NULL operators (eileenmcnaughton#423) Pathauto (eileenmcnaughton#470) fix test to use string instead of integer for zip code (eileenmcnaughton#474) 4.0.x field mappings (eileenmcnaughton#430) Adding a raw value function to return value from values array (eileenmcnaughton#465) Add filter for state province. (eileenmcnaughton#453) Update default timezone handling for dates in CiviEntityStorage.php (eileenmcnaughton#461) fix testLoadContact birthdate assertion (eileenmcnaughton#472) port to 4.0.x from 436: Include dblocale table names in list of civicrm entity info (eileenmcnaughton#438)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem/Motivation
I was working on a custom field handler and I got ResultRow class from views where I can access _entity which then has $values which has raw values of the entity fields, the entity I am working on had a contact reference field so the $values has the referred contact id and that is what I wanted, but as the $values is a protected variable I can't access it outside the class and there is no option to get the value in it. I tried using the $row->_entity->toArray() but that returns the display_name or label of the contact and not the id, I also tried civicrmApiNormalize function but the result is same.
Proposed resolution
We can add a function which acts like a getter to fetch value from the $values array.
as reported in https://www.drupal.org/project/civicrm_entity/issues/3420872