Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
607b8f4a
Commit
607b8f4a
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
#2102
Fix hang on event edit
Per
#2102
parent
1d1cf83a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Event/Form/ManageEvent/Location.php
+1
-1
1 addition, 1 deletion
CRM/Event/Form/ManageEvent/Location.php
tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php
+70
-0
70 additions, 0 deletions
tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php
with
71 additions
and
1 deletion
CRM/Event/Form/ManageEvent/Location.php
+
1
−
1
View file @
607b8f4a
...
...
@@ -231,7 +231,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
CRM_Event_BAO_Event
::
deleteEventLocBlock
(
$this
->
_oldLocBlockId
,
$this
->
_id
);
}
$isUpdateToExistingLocationBlock
=
!
empty
(
$params
[
'loc_event_id'
])
&&
(
int
)
$params
[
'loc_event_id'
]
===
$this
->
locationBlock
[
'loc_block_id'
];
$isUpdateToExistingLocationBlock
=
!
$deleteOldBlock
&&
!
empty
(
$params
[
'loc_event_id'
])
&&
(
int
)
$params
[
'loc_event_id'
]
===
$this
->
locationBlock
[
'loc_block_id'
];
// It should be impossible for there to be no default location type. Consider removing this handling
$defaultLocationTypeID
=
CRM_Core_BAO_LocationType
::
getDefault
()
->
id
??
1
;
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php
+
70
−
0
View file @
607b8f4a
...
...
@@ -110,6 +110,76 @@ class CRM_Event_Form_ManageEvent_LocationTest extends CiviUnitTestCase {
$this
->
eventDelete
(
$eventID
);
}
/**
* Test updating a location block.
*
* @throws \API_Exception
* @throws \CRM_Core_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
public
function
testUpdateLocationBlock
()
{
$eventID
=
(
int
)
$this
->
eventCreate
()[
'id'
];
$this
->
submitForm
([
'address'
=>
[
'1'
=>
[
'street_address'
=>
'Old address'
,
'supplemental_address_1'
=>
'Hallmark Ct'
,
'supplemental_address_2'
=>
'Jersey Village'
,
'supplemental_address_3'
=>
'My Town'
,
'city'
=>
'Newark'
,
'postal_code'
=>
'01903'
,
'country_id'
=>
1228
,
'state_province_id'
=>
1029
,
'geo_code_1'
=>
'18.219023'
,
'geo_code_2'
=>
'-105.00973'
,
'is_primary'
=>
1
,
'location_type_id'
=>
1
,
],
],
],
$eventID
);
$this
->
submitForm
([
'location_option'
=>
1
,
'loc_event_id'
=>
Event
::
get
()
->
addWhere
(
'id'
,
'='
,
$eventID
)
->
addSelect
(
'loc_block_id'
)
->
execute
()
->
first
()[
'loc_block_id'
],
'address'
=>
[
'1'
=>
[
'street_address'
=>
'New address'
,
'supplemental_address_1'
=>
'Hallmark Ct'
,
'supplemental_address_2'
=>
'Jersey Village'
,
'supplemental_address_3'
=>
'My Town'
,
'city'
=>
'Newark'
,
'postal_code'
=>
'01903'
,
'country_id'
=>
1228
,
'state_province_id'
=>
1029
,
'geo_code_1'
=>
'18.219023'
,
'geo_code_2'
=>
'-105.00973'
,
],
],
'email'
=>
[
'1'
=>
[
'email'
=>
''
,
],
'2'
=>
[
'email'
=>
''
,
],
],
'phone'
=>
[
'1'
=>
[
'phone_type_id'
=>
1
,
'phone'
=>
''
,
'phone_ext'
=>
''
,
],
'2'
=>
[
'phone_type_id'
=>
1
,
'phone'
=>
''
,
'phone_ext'
=>
''
,
],
],
],
$eventID
);
// Cleanup.
$this
->
eventDelete
(
$eventID
);
}
/**
* Get the values to submit for the form.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment