Skip to content

Commit 144762e

Browse files
author
Chris Gårdenberg
committed
fix: Filtering the events if we're looking at a specific one for prices as well
1 parent 6dbf4a9 commit 144762e

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

PLUGIN-CHECKSUM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1407e9f00b0c4a8134ce1402b1da499e
1+
6bcdce65f724d9b361e18f319eb111c3

content/template/detailTemplate/blocks/event-list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
if ( ! empty( $prices ) ) {
6060
foreach ( $events as $ev ) {
6161
if ( ! empty( $_GET['eid'] ) ) { // Input var okay.
62-
if ( $ev['EventId'] !== $_GET['eid'] ) { // Input var okay.
62+
if ( $ev['EventId'] != $_GET['eid'] ) { // Input var okay.
6363
continue;
6464
}
6565
}

content/template/detailTemplate/course-info.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
$events = array();
3737

3838
foreach ( $selected_course['Events'] as $event ) {
39+
if ( ! empty( $_GET['eid'] ) ) { // Input var okay.
40+
if ( $event['EventId'] != $_GET['eid'] ) { // Input var okay.
41+
continue;
42+
}
43+
}
3944
$event['CourseTemplate'] = $selected_course;
4045
unset( $event['CourseTemplate']['Events'] );
4146

includes/edu-ajax-functions.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function edu_api_listview_eventlist() {
158158
$order = array();
159159
$custom_order = explode( ' ', $custom_order_by_order );
160160
foreach ( $custom_order as $coVal ) {
161-
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, -1 );
161+
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, - 1 );
162162
}
163163
}
164164
} else {
@@ -351,7 +351,7 @@ function edu_api_listview_eventlist_template_A( $data, $request ) {
351351
}
352352

353353
include EDUADMIN_PLUGIN_PATH . '/content/template/listTemplate/blocks/event-block-a.php';
354-
$current_events++;
354+
$current_events ++;
355355
}
356356
}
357357

@@ -429,7 +429,7 @@ function edu_api_listview_eventlist_template_B( $data, $request ) {
429429
}
430430

431431
include EDUADMIN_PLUGIN_PATH . '/content/template/listTemplate/blocks/event-block-b.php';
432-
$current_events++;
432+
$current_events ++;
433433
}
434434
}
435435

@@ -482,6 +482,11 @@ function edu_api_eventlist() {
482482
$events = array();
483483

484484
foreach ( $selected_course['Events'] as $event ) {
485+
if ( ! empty( $_POST['eid'] ) ) { // Input var okay.
486+
if ( $event['EventId'] != $_POST['eid'] ) { // Input var okay.
487+
continue;
488+
}
489+
}
485490
$event['CourseTemplate'] = $selected_course;
486491
unset( $event['CourseTemplate']['Events'] );
487492

@@ -556,7 +561,7 @@ function edu_api_eventlist() {
556561
$order = array();
557562
$custom_order = explode( ' ', $custom_order_by_order );
558563
foreach ( $custom_order as $coVal ) {
559-
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, -1 );
564+
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, - 1 );
560565
}
561566
}
562567
} else {
@@ -574,7 +579,7 @@ function edu_api_eventlist() {
574579

575580
$last_city = '';
576581

577-
$show_more = ! empty( $_POST['showmore'] ) ? $_POST['showmore'] : -1;
582+
$show_more = ! empty( $_POST['showmore'] ) ? $_POST['showmore'] : - 1;
578583
$spot_left_option = $_POST['spotsleft'];
579584
$always_few_spots = $_POST['fewspots'];
580585
$show_event_venue = $_POST['showvenue'];
@@ -590,7 +595,7 @@ function edu_api_eventlist() {
590595
if ( ! empty( $prices ) ) {
591596
foreach ( $events as $ev ) {
592597
if ( isset( $_POST['eid'] ) ) {
593-
if ( $ev['EventId'] !== intval( $_POST['eid'] ) ) {
598+
if ( $ev['EventId'] != intval( $_POST['eid'] ) ) {
594599
continue;
595600
}
596601
}
@@ -611,7 +616,7 @@ function edu_api_eventlist() {
611616

612617
include EDUADMIN_PLUGIN_PATH . '/content/template/detailTemplate/blocks/event-item.php';
613618
$last_city = $ev['City'];
614-
$i++;
619+
$i ++;
615620
}
616621
}
617622
if ( empty( $prices ) || empty( $events ) ) {

0 commit comments

Comments
 (0)