Skip to content

Commit 438de4d

Browse files
committed
3.0.0-alpha-20171230
1 parent 102bc4b commit 438de4d

File tree

10 files changed

+22
-16
lines changed

10 files changed

+22
-16
lines changed

global/code/Core.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class Core {
256256
/**
257257
* The release date: YYYYMMDD
258258
*/
259-
private static $releaseDate = "20171225";
259+
private static $releaseDate = "20171230";
260260

261261
/**
262262
* The minimum required PHP version needed to run Form Tools.

global/code/FieldValidation.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ public static function generateSubmissionJsValidation($grouped_fields, $settings
272272
foreach ($field_info["validation"] as $rule_info) {
273273
$rsv_rule = $rule_info["rsv_rule"];
274274
$placeholders = array(
275-
"field" => $field_title,
276-
"field_name" => $field_name
275+
"field" => $field_title,
276+
"field_name" => $field_name
277277
);
278278
$message = General::evalSmartyString($rule_info["error_message"], $placeholders);
279279

global/code/Forms.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
namespace FormTools;
1010

1111

12-
use PDO, PDOException;
12+
use PDO, Exception;
1313

1414

1515
class Forms
1616
{
1717
/**
1818
* Returns all forms. Should only be called by adminstrators.
19+
* *** N.B. This doesn't return offline forms. ***
1920
* @return array
2021
*/
2122
public static function getForms()
@@ -63,7 +64,7 @@ public static function cacheFormStats($form_id = "")
6364
$db->execute();
6465
$count = $db->fetch(PDO::FETCH_COLUMN);
6566
Sessions::set("form_{$form_id}_num_submissions", $count);
66-
} catch (PDOException $e) {
67+
} catch (Exception $e) {
6768
// need a softer error here. If the form table doesn't exist, we need to log the issue.
6869
// Errors::queryError(__CLASS__, __FILE__, __LINE__, $e->getMessage());
6970
// exit;

global/code/General.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,11 @@ public static function getSubmissionPlaceholders($form_id, $submission_id, $cont
11941194
if (in_array($field_type_id, $file_field_type_ids)) {
11951195
$field_settings = Fields::getFieldSettings($field_id);
11961196
$placeholders["FILENAME_$field_name"] = $field_info["content"];
1197-
$placeholders["FILEURL_$field_name"] = "{$field_settings["folder_url"]}/{$field_info["content"]}";
1197+
1198+
// not sure under what condition this value isn't set but it was throwing a notice on the edit submission page
1199+
if (isset($field_settings["folder_url"])) {
1200+
$placeholders["FILEURL_$field_name"] = "{$field_settings["folder_url"]}/{$field_info["content"]}";
1201+
}
11981202
} else {
11991203
$detailed_field_info = array();
12001204
foreach ($form_fields as $curr_field_info) {

global/code/Module.abstract.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function upgrade($module_id, $old_module_version) {
106106

107107
// non-overridable getters
108108

109-
public final function displayPage($template, $page_vars = array()) {
109+
public final function displayPage($template, $page_vars = array(), $theme = "", $swatch = "") {
110110

111111
// add in the JS and CSS files
112112
if (!isset($page_vars["js_files"])) {
@@ -131,7 +131,7 @@ public final function displayPage($template, $page_vars = array()) {
131131
$page_vars["js_files"] = array_merge($page_vars["js_files"], self::getJSFiles());
132132
$page_vars["css_files"] = array_merge($page_vars["css_files"], self::getCSSFiles());
133133

134-
Themes::displayModulePage($this->getModuleFolder(), $template, $page_vars);
134+
Themes::displayModulePage($this->getModuleFolder(), $template, $page_vars, $theme, $swatch);
135135
}
136136

137137
// note that this method and the following actually returns the values from the CURRENT LANG FILE, not the private

global/code/Modules.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ public static function initModulePage($auth = "")
687687
return self::getModuleInstance($module_folder);
688688
}
689689

690-
// should only be called after isValidModule() has been called first
690+
// should only be called after isValidModule() has been called first
691691
public static function getModuleInstance($module_folder) {
692692
if (array_key_exists($module_folder, self::$moduleInstances)) {
693693
return self::$moduleInstances[$module_folder];

global/code/User.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,14 @@ public function checkAuth($required_account_type, $auto_logout = true)
341341
$account_id = $this->accountId;
342342
$account_type = $this->accountType;
343343

344+
// This will all be refactored when we introduce role-based auth
345+
// ----------------
344346
// some VERY complex logic here. The "user" account permission type is included so that people logged in
345347
// via the Submission Accounts can still view certain pages, e.g. pages with the Pages module. This checks that
346348
// IF the minimum account type of the page is a "user", it EITHER has the user account info set (i.e. the submission ID)
347349
// or it's a regular client or admin account with the account_id set. Crumby, but it'll have to suffice for now.
348350
if ($this->accountType == "user") {
351+
349352
if ((!Sessions::exists("account.submission_id") || General::isEmpty(Sessions::get("account.submission_id"))) &&
350353
General::isEmpty(Sessions::get("account.account_id"))) {
351354
if ($auto_logout) {

global/smarty_plugins/function.edit_custom_field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function smarty_function_edit_custom_field($params, &$smarty)
1414
$root_url = Core::getRootUrl();
1515
$multi_val_delimiter = Core::getMultiFieldValDelimiter();
1616

17-
if (!Templates::hasRequiredParams($smarty, $params, array("form_id", "field_info", "field_types", "settings"))) {
17+
if (!Templates::hasRequiredParams($smarty, $params, array("form_id", "field_info", "field_types"))) {
1818
return;
1919
}
2020

tests/nightwatch/nightwatch.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
"log_path" : "",
1313
"port" : 4444,
1414
"cli_args" : {
15-
"webdriver.chrome.driver" : "",
16-
"webdriver.gecko.driver" : "",
17-
"webdriver.edge.driver" : ""
15+
"webdriver.chrome.driver" : "./drivers/chromedriver"
1816
}
1917
},
2018

themes/default/header.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<body>
3333
<div id="container">
3434
<div id="header">
35-
{if $is_logged_in}
35+
{if $is_logged_in && isset($settings.program_version)}
3636
<div style="float:right">
3737
<table cellspacing="0" cellpadding="0" height="25">
3838
<tr>
@@ -57,9 +57,9 @@
5757
{/if}
5858
5959
<span style="float:left; padding-top: 8px; padding-right: 10px">
60-
{if isset($settings) && $settings.logo_link}
60+
{if isset($settings) && isset($settings.logo_link)}
6161
<a href="{$settings.logo_link}">{/if}<img src="{$theme_url}/images/logo_{$swatch}.jpg" border="0" width="220" height="61" />
62-
{if isset($settings) && $settings.logo_link}</a>{/if}
62+
{if isset($settings) && isset($settings.logo_link)}</a>{/if}
6363
</span>
6464
</div>
6565
<div id="content">

0 commit comments

Comments
 (0)