Skip to content

Commit d0d200f

Browse files
author
Chris Gårdenberg
committed
- fix: Fixed a problem with showing price names in the detail view.
- add: Added extra check for regions, so we don't loop over empty objects
1 parent 881225e commit d0d200f

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

content/template/detailTemplate/course-info.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
$pricenames = array();
3737
foreach ( $selected_course['PriceNames'] as $pn ) {
38-
$pricenames[] = $pn['Price'];
38+
$pricenames[] = $pn;
3939
}
4040
foreach ( $event['PriceNames'] as $pn ) {
41-
$pricenames[] = $pn['Price'];
41+
$pricenames[] = $pn;
4242
}
4343

4444
$event = array_merge( $event['CourseTemplate'], $event );

content/template/listTemplate/search/region.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

33
$regions_with_public_locations = array();
4-
foreach ( $regions['value'] as $region ) {
5-
foreach ( $region['Locations'] as $location ) {
6-
if ( $location['PublicLocation'] ) {
7-
$regions_with_public_locations[] = $region;
8-
break;
4+
if ( ! empty( $regions ) && ! empty( $regions['value'] ) ) {
5+
foreach ( $regions['value'] as $region ) {
6+
foreach ( $region['Locations'] as $location ) {
7+
if ( $location['PublicLocation'] ) {
8+
$regions_with_public_locations[] = $region;
9+
break;
10+
}
911
}
1012
}
1113
}

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ This method generates a unique transient-name based on the name and the argument
4545
- chg: Redoing most of the code fetching data from EduAdmin (Adding `$select`, to decrease the amount of data fetched)
4646
- add: Added new class `EduAdminAPIHelper`, that I'm using to deduplicate code.
4747
- per: Adding more performance fixes, that should solve some issues.
48-
48+
- fix: Fixed a problem with showing price names in the detail view.
49+
- add: Added extra check for regions, so we don't loop over empty objects
4950

5051
### 2.0.18
5152
- fix: Proper sorting on event dates. (Using `sort` on an `array` was stupid)..

0 commit comments

Comments
 (0)