Skip to content

Commit

Permalink
fixed issue with dataset variables and returns
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhunt committed Aug 6, 2021
1 parent 5f72280 commit 7ef2f20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change List
=========
Version 1.4.13(Build 2021080600)
- fixed issue where numeric variables to dataset where forced as int
- fixed issue where in the case of only 1 returned entry in dataset it was not available in JS

Version 1.4.12 (Build 2021021700)
- added filter/generico:managetemplates capability to make it easier to build roles with access to Generico as per https://github.com/justinhunt/moodle-filter_generico/issues/26

Expand Down
4 changes: 2 additions & 2 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function filter_generico_callback(array $link) {
$query_vars = array();
for ($i = 0; $i < sizeof($vars); $i++) {
if (is_numeric($vars[$i])) {
$query_vars[] = intval($vars[$i]);
$query_vars[] = 0 + $vars[$i];
} else {
$query_vars[] = $vars[$i];
}
Expand All @@ -426,7 +426,7 @@ function filter_generico_callback(array $link) {
$filterprops['DATASET'] = $alldata;
//replace the specified names with spec values, if its a one element array
if (sizeof($filterprops['DATASET']) == 1) {
$thedata = get_object_vars(array_pop($alldata));
$thedata = get_object_vars(reset($alldata));
foreach ($thedata as $name => $value) {
$genericotemplate = str_replace('@@DATASET:' . $name . '@@', $value, $genericotemplate);
$alternate_content = str_replace('@@DATASET:' . $name . '@@', $value, $alternate_content);
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2021021700; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2021080600; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011070100; // Requires this Moodle version
$plugin->component = 'filter_generico'; // Full name of the plugin (used for diagnostics)
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'Version 1.4.12(Build 2021021700)';
$plugin->release = 'Version 1.4.13(Build 2021080600)';

0 comments on commit 7ef2f20

Please sign in to comment.