Skip to content

Commit

Permalink
Event keys fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjasoturi committed Aug 18, 2021
1 parent d2ba1d0 commit 81ec921
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions logic/keys_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
* @param $action
* @return array
*/
function event_keys($gym_id_plus_letter, $action) {
function keys_event($gym_id_plus_letter, $action) {
$q = my_query("
SELECT id,
name
FROM
events
FROM events
WHERE id != 999
");
while($event = $q->fetch()) {
$keys[] = array(
'text' => $event['name'],
'callback_data' => $gym_id_plus_letter . ':' . $action . ':' . $event['id']
);
if(!empty($event['name'])) {
$keys[] = array(
'text' => $event['name'],
'callback_data' => $gym_id_plus_letter . ':' . $action . ':' . $event['id']
);
}else {
info_log('Invalid event name on event '. $event['id']);
}
}
$keys[] = array(
'text' => getTranslation("Xstars"),
Expand Down
2 changes: 1 addition & 1 deletion mods/edit_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$gym_id_plus_letter = $data['id'];

// Get the keys.
$keys = event_keys($gym_id_plus_letter, "edit_event_raidlevel");
$keys = keys_event($gym_id_plus_letter, "edit_event_raidlevel");

// No keys found.
if (!$keys) {
Expand Down

0 comments on commit 81ec921

Please sign in to comment.