Skip to content

Commit b334b06

Browse files
committed
Returning to FT for PHP 8 support
1 parent e477464 commit b334b06

File tree

10 files changed

+377
-413
lines changed

10 files changed

+377
-413
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v14.20.0

gruntfile.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
const fs = require('fs');
22
const path = require('path');
33
const lineByLine = require('n-readlines');
4-
const sass = require('node-sass');
4+
const sass = require('sass');
55
const pkg = require('./package.json');
66
const child_process = require('child_process');
77

88
const release_folder = 'formtools_releases';
99
const formtools_releases_folder = path.resolve(__dirname, '..', release_folder);
1010

11-
1211
// i18n string keys that aren't used in the Core, but useful for multiple other modules, so placed here. These allow
1312
// the `grunt i18n` task to pass
1413
const globalI18nStrings = [
@@ -116,7 +115,7 @@ const config = {
116115
tasks: ['sync']
117116
},
118117
api: {
119-
files: [path.resolve(__dirname, '..', active_api) + '/**'],
118+
files: [path.resolve(__dirname, '..', active_api || '') + '/**'],
120119
tasks: ['sync']
121120
}
122121
},
@@ -467,5 +466,4 @@ module.exports = function (grunt) {
467466

468467
// builds everything into the dist folder
469468
grunt.registerTask('prod', ['i18n', 'sync', 'sass', 'run:webpack_prod']);
470-
471469
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
"eslint": "^6.5.1",
9696
"eslint-plugin-react": "^7.16.0",
9797
"exec": "^0.2.1",
98-
"grunt": "^1.0.3",
99-
"grunt-cli": "^1.2.0",
98+
"grunt": "^1.5.3",
99+
"grunt-cli": "^1.4.3",
100100
"grunt-concurrent": "^2.3.1",
101101
"grunt-contrib-cssmin": "^3.0.0",
102102
"grunt-contrib-uglify": "^4.0.0",
@@ -111,7 +111,6 @@
111111
"mini-css-extract-plugin": "^0.8.0",
112112
"moment": "^2.22.2",
113113
"n-readlines": "^1.0.0",
114-
"node-sass": "^4.12.0",
115114
"postcss-loader": "^3.0.0",
116115
"prop-types": "^15.6.1",
117116
"reselect": "^3.0.1",
@@ -135,6 +134,7 @@
135134
"react-select": "^3.0.4",
136135
"redux": "^4.0.0",
137136
"redux-actions": "^2.3.2",
138-
"redux-thunk": "^2.2.0"
137+
"redux-thunk": "^2.2.0",
138+
"sass": "^1.57.1"
139139
}
140140
}

src/global/code/Emails.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public static function sendTestEmail($info)
301301
$email_id = Sessions::get("email_id");
302302
$submission_id = (isset($info["submission_id"]) && !empty($info["submission_id"])) ? $info["submission_id"] : "";
303303

304-
list ($success, $email_info) = self::getEmailComponents($form_id, $submission_id, $email_id, true, $info);
304+
list ($success, $email_info) = self::getEmailComponents($form_id, $email_id, $submission_id, true, $info);
305305
if (!$success) {
306306
return array(false, $email_info);
307307
}
@@ -386,7 +386,7 @@ public static function sendTestEmail($info)
386386
* @param integer $email_id
387387
* @return array
388388
*/
389-
public static function getEmailComponents($form_id, $submission_id = "", $email_id, $is_test = false, $test_settings = array())
389+
public static function getEmailComponents($form_id, $email_id, $submission_id = "", $is_test = false, $test_settings = array())
390390
{
391391
$LANG = Core::$L;
392392
$root_dir = Core::getRootDir();
@@ -1282,7 +1282,7 @@ public static function sendEmails($event, $form_id, $submission_id)
12821282
*/
12831283
public static function processEmailTemplate($form_id, $submission_id, $email_id)
12841284
{
1285-
list($success, $email_components) = self::getEmailComponents($form_id, $submission_id, $email_id);
1285+
list($success, $email_components) = self::getEmailComponents($form_id, $email_id, $submission_id);
12861286

12871287
if (!$success) {
12881288
return array(false, "Email components not returned properly (Emails::getEmailComponents).");

src/global/code/FieldTypes.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This file contains all functions relating to the field types (select, radios etc). Added in 2.1.0
55
* with the addition of Custom Fields.
66
*
7-
* @copyright Benjamin Keen 2018
7+
* @copyright Benjamin Keen 2023
88
* @author Benjamin Keen <ben.keen@gmail.com>
99
* @package 3-0-x
1010
*/
@@ -710,7 +710,7 @@ public static function getFieldTypeProcessingInfo()
710710
* @param $field_ids
711711
* @return array a hash of [field_id][identifier] = values
712712
*/
713-
public static function getFormFieldFieldTypeSettings($field_ids = array(), $form_fields)
713+
public static function getFormFieldFieldTypeSettings($field_ids, $form_fields)
714714
{
715715
$db = Core::$db;
716716

@@ -1439,7 +1439,7 @@ public static function get($return_settings = false, $field_type_ids = array())
14391439
SELECT *, g.list_order as group_list_order, ft.list_order as field_type_list_order
14401440
FROM {PREFIX}field_types ft, {PREFIX}list_groups g
14411441
WHERE g.group_type = :field_types AND
1442-
ft.group_id = g.group_id AND
1442+
ft.group_id = g.group_id AND
14431443
ft.field_type_id IN ($field_type_id_str)
14441444
ORDER BY g.list_order, ft.list_order
14451445
");
@@ -1534,7 +1534,7 @@ public static function addFieldTypeSettingOptions($options)
15341534
{
15351535
$db = Core::$db;
15361536

1537-
$query = "INSERT INTO {PREFIX}field_type_setting_options (setting_id, option_text, option_value, option_order,
1537+
$query = "INSERT INTO {PREFIX}field_type_setting_options (setting_id, option_text, option_value, option_order,
15381538
is_new_sort_group) VALUES (:setting_id, :option_text, :option_value, :option_order, :is_new_sort_group)";
15391539

15401540
foreach ($options as $option) {
@@ -1558,7 +1558,7 @@ public static function deleteFieldTypeSettingsByFieldTypeId($field_type_id)
15581558
$db->query("
15591559
SELECT setting_id
15601560
FROM {PREFIX}field_type_settings
1561-
WHERE field_type_id = :field_type_id
1561+
WHERE field_type_id = :field_type_id
15621562
");
15631563
$db->bind("field_type_id", $field_type_id);
15641564
$db->execute();
@@ -1878,7 +1878,7 @@ public static function resetFieldTypeSettings ($field_type_data)
18781878
// here, this is a new setting added to the field type that the users installation doesn't have
18791879
if ($found_setting === null) {
18801880
$db->query("
1881-
INSERT INTO {PREFIX}field_type_settings (field_label, field_type, field_orientation, default_value_type,
1881+
INSERT INTO {PREFIX}field_type_settings (field_label, field_type, field_orientation, default_value_type,
18821882
default_value, list_order)
18831883
VALUES (:field_label, :field_type, :field_orientation, :default_value_type, :default_value, :list_order)
18841884
");

src/global/code/actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
case "display_test_email":
172172
$form_id = Sessions::get("form_id");
173173
$email_id = Sessions::get("email_id");
174-
$info = Emails::getEmailComponents($form_id, "", $email_id, true, $request);
174+
$info = Emails::getEmailComponents($form_id, $email_id, "", true, $request);
175175
echo returnJSON($info);
176176
break;
177177

src/install/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Core::setCurrentLang(General::loadField("lang", "lang", Core::getDefaultLang()));
1919
$root_url = Core::getRootUrl();
2020
$LANG = Core::$L;
21+
2122
?>
2223
<!doctype html>
2324
<html>

src/react/installation/pages/Step5.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Step5 extends Component {
1313

1414
if (errorLoading) {
1515
return (
16-
<div>blah.</div>
16+
<div>Error: {errorLoading}</div>
1717
);
1818
}
1919

src/react/store/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import reducer from './reducers';
1+
import * as reducer from './reducers';
22
import * as actions from './actions';
33
import * as selectors from './selectors';
44

0 commit comments

Comments
 (0)