Skip to content

Commit f19fc49

Browse files
author
Chris Gårdenberg
committed
- fix: Interest registration on events, now actually know which event the user selected
1 parent f3937e2 commit f19fc49

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

content/template/interestRegTemplate/interest-reg-event.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
include_once 'send-event-inquiry.php';
1111
}
1212

13-
$course_id = $wp_query->query_vars['courseId'];
13+
$course_id = $wp_query->query_vars['courseId'];
1414
$group_by_city = get_option( 'eduadmin-groupEventsByCity', false );
1515
$fetch_months = get_option( 'eduadmin-monthsToFetch', 6 );
1616
if ( ! is_numeric( $fetch_months ) ) {
1717
$fetch_months = 6;
1818
}
19-
$edo = json_decode( EDUAPIHelper()->GetCourseDetailInfo( $course_id, $fetch_months, $group_by_city ), true );
19+
$edo = json_decode( EDUAPIHelper()->GetCourseDetailInfo( $course_id, $fetch_months, $group_by_city ), true );
2020

2121
$selected_course = false;
2222
$name = '';
@@ -41,7 +41,16 @@
4141
die();
4242
}
4343

44-
$event = $events[0];
44+
if ( ! empty( $_REQUEST['eid'] ) && is_numeric( $_REQUEST['eid'] ) ) {
45+
foreach ( $events as $_event ) {
46+
if ( $_event['EventId'] === intval( $_REQUEST['eid'] ) ) {
47+
$event = $_event;
48+
break;
49+
}
50+
}
51+
} else {
52+
$event = $events[0];
53+
}
4554

4655
?>
4756
<div class="eduadmin">

eduadmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin URI: https://www.eduadmin.se
1010
* Description: EduAdmin plugin to allow visitors to book courses at your website
1111
* Tags: booking, participants, courses, events, eduadmin, lega online
12-
* Version: 2.0.27
12+
* Version: 2.0.28
1313
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1414
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1515
* Requires at least: 4.7

readme.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: mnchga
33
Tags: booking, participants, courses, events, eduadmin, lega online
44
Requires at least: 4.7
5-
Tested up to: 4.9
6-
Stable tag: 2.0.27
5+
Tested up to: 5.0
6+
Stable tag: 2.0.28
77
Requires PHP: 5.2
88
License: GPL3
99
License-URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -37,6 +37,9 @@ If you notice that your API key doesn't work any more, you have to contact us.
3737

3838
== Changelog ==
3939

40+
### 2.0.28
41+
- fix: Interest registration on events, now actually know which event the user selected
42+
4043
### 2.0.27
4144
- add: Better civregno-check for contact persons if the course requires it.
4245

0 commit comments

Comments
 (0)