-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#5053 Afform - Add support for saving event location #30140
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
The issue associated with the Pull Request can be viewed at https://lab.civicrm.org/dev/core/-/issues/5053 |
Test fail is probably related:
|
Non-blocking comment but probably our only opportunity if we wanted to.. How hard would it be to rename the entity from LocBlock to LocationBlock? |
The LocBlock entity is a horrible design and the name is the least of its problems. I wouldn't bother renaming it since what it really needs is to be ripped out. |
'where' => [['id', '=', $mainEntityId]], | ||
'select' => [$forwardFkField['name']], | ||
])->first(); | ||
return [$joinIdField, '=', $mainEntityJoinValue[$forwardFkField['name']] ?? 0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw Should this return an array of current return value? I get the following error when trying to prefill the afform with event id in URL (happens only if location block is included).
TypeError: array_pad(): Argument #1 ($array) must be of type array, string given in array_pad() (line 303 of web/sites/all/modules/civicrm/Civi/Api4/Query/Api4SelectQuery.php).
I have just started to test. On the back end there is a field to state whether it is a new location or not. This field does not exist in FB. Maybe I should add a custom field so that I display the existing location or not (cond rule). I try to create an autocomplete on the addresses. It works well in SK (with address, postal code, town). In form builder, I can set the Search and the autocomplete display. But when i run the form, it only shows the ID and does not apply the criteria (to limit the number of addresses). |
Thanks for testing @Guydn |
It's already possible to read fields in this format so it makes sense to be able to write them this way too.
7fdff5c
to
e5dbfd5
Compare
@Guydn I've added support for autocomplete + autofill of location info. It was extremely challenging! |
I can't merge patch on 5.76.1 as a file is missing
and on 5.78.1 I'm blocked a bit afterwards
|
@allinappliadmin that file exists in the RC but not your version. I don't think it's critical to this PR so you could just ignore it. @civicrm-builder retest this please |
should the test work on the 5.76.1? |
@allinappliadmin I think so. One or more files will not patch, but that's probably ok. |
There is now a "block address" that is available in the event fields in FB. There are 3 main display possibilities: "autocompletion"," id. location", "select location form". I prepared an autocompletion search (on entity address "with" address addresses "with" event location, "grouped by" id. address). When i select autocompletion, i try to select my search but I cannot see it and therefore cannot see my autocompletion display. I'm missing something. -> fixed ! :-) my search is now entity address (with a map) with address location, with event location. If I select "id. location", it is an integer. I do not see how this option can be used. If i select "select location form", i do not understand how to use it. If I want to customize the options then the whole FB edit screen is frozen. |
@Guydn I'm not entirely sure what you mean. Could you add a screenshot to illustrate what you mean by "quick add" and "id. location is an integer" and also "select location form". Thanks. |
@Guydn ok, I see the confusion. That field is "address_id" and it should not be there. I'm removing it. Sorry for the confusion. |
8dca139
to
ce7d792
Compare
applying the patch on 5.76.1 leads to fatal error. Many files to be patched were lacking. Should I upgrade to RC (5.77)? |
@allinappliadmin yes upgrading to the RC should help you apply the patch. |
Still having a missing file notice while patching the RC
@Guydn can you test and confirm it works as expected? |
@allinappliadmin that file is not important. You can just delete it from the patch. |
On another environment (Civi 5.73, WP 6.6) managed by @mlutfy the patch works (good news !) but this patch was complex to implement. |
Thanks a lot @colemanw it works well now on wpmaster :-) ! |
I have discovered a issue (Wpmaster 5.79 Alpha1) that is critical to use the feature https://lab.civicrm.org/dev/core/-/issues/5465 |
Overview
Fulfills feature request from https://lab.civicrm.org/dev/core/-/issues/5053
Before
Not possible to save email/phone/address when creating an event via Afform
After
Support added for those fields, in the form of a block.