Commit Graph

188 Commits

Author SHA1 Message Date
Steve Boyd
ce2fe31bdd Merge branch '5.7' into 5.8 2021-01-17 15:58:55 +13:00
Dylan Wagstaff
c0a30f1b6a
FIX unrequire fields when they become dataless (#1016)
* FIX unrequire fields when they become dataless

When fields that collect input data are changed in configuration via the
CMS to become fields that no longer collect input data (e.g. TextField
-> HTML Block), submitting the resulting form results in a fatal error,
server 500 response, etc. due to trying to check if a field without data
(ever) has data in it.

To circumvent this we can set the required state to false if the field
is being converted to one that does not collect data (which FormField
API conveniently provides a check for).

* Move parent::onBeforeWrite() to top of function

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2021-01-17 15:55:47 +13:00
Michal Kleiner
66bbe44972
FIX Add missing dots in translation string references 2020-12-02 10:01:50 +13:00
Steve Boyd
f81360e737 Merge branch '5.7' into 5 2020-11-12 15:18:00 +13:00
Steve Boyd
ead1827aa1 Merge branch '5.6' into 5.7 2020-11-12 15:17:31 +13:00
Steve Boyd
2a47b1821e NEW Extension to link file submissions to userform on the used on table 2020-11-04 11:47:50 +13:00
Dylan Wagstaff
0ce94b75f5 FIX correctly calculate MaxFileSizeMB
The inputted value is intended to represent megabytes, but is only
multiplied by 1024 - meaning it'd represent kilobytes. This is then used
to compare with the PHP setting number, which is bytes in the range of
megabytes. Kilobytes are always under megabytes, meaning size
comparisons elsewhere in the code are always true.
We should ensure the calculation for validation is correct.
2020-11-01 11:31:23 +13:00
Maxime Rainville
d2bf27c847
MNT Fix broken merged up (#1013) 2020-10-22 15:47:17 +13:00
Maxime Rainville
4eb0fe25b9 Merge branch '5.5' into 5.6 2020-10-22 10:22:19 +13:00
Steve Boyd
81fcd669a2 FIX Show custom validation message for checkbox and radio groups 2020-07-21 17:30:55 +12:00
Steve Boyd
46c6d93d9c Merge branch '5.6' into 5 2020-07-17 23:24:37 +12:00
Steve Boyd
59cd87d842 FIX Trim recipient email addresses before write 2020-07-14 16:41:36 +12:00
Maxime Rainville
27228d12af [CVE-2020-9309] Require MimeUploadValidator on userformis' File Upload field 2020-07-13 11:33:46 +12:00
3Dgoo
6ca8ce2596
FIX Fixing plain email blank file field value (#940)
* Fixing plain email blank file field value
2020-07-01 09:00:31 +12:00
Maxime Rainville
25978d3c58 Clean up tests 2020-06-12 00:55:12 +12:00
Andre Kiste
3b40be3b8f
NEW Add folder confirmation modal when adding a new EditableFileField to a userform. (#972) 2020-06-10 16:59:01 +12:00
Garion Herman
14ce51e517
NEW Improve Unrestricted Folder warning, bump core requirement to ^4.6 (#965) 2020-06-09 21:01:09 +12:00
Maxime Rainville
e2c05d5a55 Minor linting adjustment. 2020-01-14 12:28:04 +13:00
Maxime Rainville
d280c54860 Patch and reorganise some test 2020-01-13 12:15:34 +13:00
Maxime Rainville
793f437289 API Mark EditableFormField::EffectiveDisplayRules() for deprecation 2020-01-13 12:12:14 +13:00
Maxime Rainville
a0cedaeb38 Move conditionalFieldEnabled to EditableFormField as isDisplayed 2020-01-10 17:36:04 +13:00
Jess Champion
25bfc9eaf5 Required fields can have display rules. Hidden required fields are dynamically excluded from server and client side validation. 2020-01-10 10:41:59 +13:00
Charlie Bergthaler
dfeb922818
FIX Add missing import statement for SilverStripe\ORM\ValidationResult in UserDefinedFormController and EditableFileField. 2019-10-07 21:56:22 +13:00
Marco (Valandur)
0348e5dd15 fix(submitted-form): Pass member to parent calls 2019-09-06 15:37:13 +02:00
Marco (Valandur)
696fa1d05e fix(submitted-form): canCreate not checking parent 2019-09-05 12:12:26 +02:00
Bram de Leeuw
8703ace32a validate that a classname had been set 2019-07-15 11:15:30 +02:00
Remy Vaartjes
f682e74f44 Enable 4.4 better button functionality 2019-07-08 14:26:58 +02:00
Guy Marriott
d7c76ecf80
FIX Preview email link now handles cases where it's loaded in the browser, requested via AJAX and used in a trait or a page context (#887)
FIX Preview email link now handles cases where it's loaded in the browser, requested via AJAX and used in a trait or a page context
2019-05-27 20:01:56 +12:00
Robbie Averill
483fbc8499 FIX Preview email link now handles cases where it's loaded in the browser, requested via AJAX and used in a trait or a page context 2019-05-17 15:51:11 +12:00
Robbie Averill
d0e937a588 FIX Allowed text length fields now align correctly with each other 2019-05-17 15:12:57 +12:00
Robbie Averill
d141c83e0a Import missing PHPDoc doc blocks, switch intval() for (int) casting 2019-05-17 14:56:00 +12:00
Garion Herman
2f0aea847a Add presence validation for EmailRecipient recipient, add error handling 2019-05-03 16:46:32 +12:00
Robbie Averill
1ac3f5a97c Merge branch '5.3' into 5.4 2019-05-02 11:02:23 +12:00
Robbie Averill
5f3014ac54 Merge branch '5.2' into 5.3 2019-05-02 11:02:12 +12:00
Robbie Averill
c7cd970024 Merge branch '5.1' into 5.2 2019-05-02 11:01:59 +12:00
Robbie Averill
79e343c1d9 Merge branch '5.0' into 5.1 2019-05-02 11:01:50 +12:00
Joe Harvey
2cd0602886 Remove unnecessary isset() check 2019-05-01 09:16:22 +12:00
Joe Harvey
418017494f Prevent 'undefined index' warnings when optional country dropdown fields are left empty 2019-05-01 09:16:22 +12:00
Robbie Averill
a4cd982637 Merge branch '5.3' 2019-03-26 14:46:22 +13:00
Robbie Averill
bf142eb6ef FIX Display rules for page breaks/editable form steps now works again
This was previously broken in a regression from https://github.com/silverstripe/silverstripe-userforms/pull/575
where the fields themselves could still be toggled, but the jQuery event dispatches for the form steps
were removed. This pull request re-introduces those jQuery event triggers when hiding and showing
editable form fields via display rules.
2019-03-25 15:09:38 +13:00
Robbie Averill
e36de481cc Merge branch '5.3' 2019-03-19 12:05:54 +13:00
pjayme
b49d38ff0f updated canCreate function to check for Parent object 2019-03-13 10:18:41 +13:00
pjayme
d8a8ddc61d re-added can* methods for EditableOption field 2019-03-13 09:20:51 +13:00
Robbie Averill
b2101c15fc
Merge pull request #851 from LukeAmos/issue/850
FIX Fixes #850 added validation to numerical form fields
2019-01-16 22:12:32 +01:00
Robbie Averill
f235c8642c Add unit tests for EditableNumericField::validate() 2019-01-16 21:59:02 +01:00
Luke Amos
d917262565 FIX Fixes #850 Considered location following peer feedback 2019-01-17 09:20:31 +13:00
Luke Amos
ca06f000a1 FIX Fixes #850 added validation to numerical form fields 2019-01-16 23:32:15 +13:00
Jose Pereira
0fd0b3fc1f FIX: Fixes #833 After peer review. 2019-01-16 15:08:42 +13:00
Jose Pereira
4ebcfccf44 FIX: Fixes #833 fixes after peer review 2019-01-16 13:50:16 +13:00
Jose Pereira
7406670003 Fix: Fixes after peer review for #833 2019-01-16 12:24:28 +13:00
Jose Pereira
2ac6ae6a47 FIX: Fixes #833 added validation for minimum and maximum length 2019-01-16 11:15:53 +13:00
Sacha Judd
2682abea73 NEW Add font-icon for site tree userform page 2019-01-14 13:39:27 +13:00
Robbie Averill
dd5dbe3123 Merge branch '5.2' into 5.3 2019-01-10 12:26:32 +01:00
Robbie Averill
2fd1c1b504 Merge branch '5.1' into 5.2
# Conflicts:
 #	.travis.yml
2019-01-10 12:26:18 +01:00
Robbie Averill
7a9ca8fcfd Merge branch '5.0' into 5.1 2019-01-10 12:25:40 +01:00
Nicolaas
96be46a6ac FIX Fixing escape error in required identifier 2019-01-10 12:13:13 +01:00
Scott Hutchinson
5cce7cb519 FIX app email templates not resolving correctly 2018-11-18 14:08:53 +13:00
David Toews
5271f14998 Allows placeholder value of '0' 2018-10-01 16:20:33 -06:00
Indy Griffiths
2b4451cdac FIX DefaultToToday date format
Fixes incorrectly using the minute (m) instead of the month (M) and switches to showing an 2018-09-21 format value
2018-09-22 13:43:00 +02:00
Robbie Averill
c88d6b1566 FIX Recipient email content previews now when when userforms is used in a trait context 2018-09-07 10:45:11 +02:00
Robbie Averill
f734c2f033 FIX Do not override core translation for 'field is required' 2018-09-03 13:37:21 +02:00
Dylan Wagstaff
76540d8ffc
Merge pull request #799 from creative-commoners/pulls/5.2/double-escaped-html
FIX Submitted form field values are no longer double escaped in the CMS
2018-08-27 12:42:11 +12:00
Robbie Averill
04cdac2229
Merge pull request #736 from creative-commoners/pulls/5.0/Postgre
Test against PgSQL also
2018-08-21 15:17:56 +12:00
Robbie Averill
cc3ea728e4 FIX Postgres compatibility in requireDefaultRecords database queries 2018-08-21 15:04:51 +12:00
Robbie Averill
ab402b117c FIX Submitted form field values are no longer double escaped in the CMS 2018-08-15 18:22:36 +12:00
Robbie Averill
075985d9c9 Add translation to "Submitter" field label 2018-08-15 16:42:44 +12:00
Robbie Averill
ba9bbfaed5 FIX Remove divider line and add margin underneath Submissions GridField 2018-08-15 16:39:44 +12:00
Daniel Hensby
bf086806dc
Merge branch '5.1' 2018-05-09 14:06:12 +01:00
Daniel Hensby
8809d516c4
Merge branch '5.0' into 5.1 2018-05-09 14:03:34 +01:00
Daniel Hensby
e4871b880c
Merge branch '4.5' into 5.0 2018-05-09 14:01:17 +01:00
Jake Bentvelzen
07ca22e729 fix(SubmittedFormField): Fix bug where FormattedValue isn't cast to HTMLFragment, which causes <br/> to appear in Email templates. 2018-05-09 16:31:40 +10:00
Chen Shenghan
b205ca952a NEW default value for Country Dropdown (add i18n to the new fields) 2018-05-02 13:57:47 +12:00
Chen Shenghan
8870833318 NEW empty default value for Country Dropdown 2018-05-01 16:07:03 +12:00
Chen Shenghan
4d89705fe6 NEW default value for Country Dropdown 2018-04-30 22:20:28 +12:00
Dylan Wagstaff
569b0a7627 FIX use the same translation variable key as core (#755)
This way when this translation string overrides the core one, the core
triggered translations will still continue working.
2018-03-29 09:29:15 +13:00
Robbie Averill
453a35e114
FIX Ensure duplicated multiple option field is written (has an ID) before duplicating options 2018-03-27 10:34:42 +01:00
Robbie Averill
3e71cf7840
Add tests for duplicating multiple option fields, which should duplicate the options too 2018-03-27 10:34:41 +01:00
Robbie Averill
7cbffd8c84 FIX Use a userforms template for the member list field, fixes broken display rules 2018-03-26 11:33:25 +13:00
Dylan Wagstaff
0a9f3f4365
Merge pull request #754 from creative-commoners/pulls/5.0/allow-empty-field-titles
FIX Allow editable form fields to have nullable titles rather than fallback to Name
2018-03-26 11:05:06 +13:00
Robbie Averill
5cce5f5a17 FIX Allow editable form fields to have nullable titles rather than fallback to Name 2018-03-23 16:25:06 +13:00
Robbie Averill
86b098ccf5 FIX Disable versioned GridField extensions - it conflicts with UserFormRecipientItemRequest 2018-03-23 11:10:13 +13:00
Robbie Averill
92a2229249 FIX Correctly return the max file size in MB 2018-03-22 16:51:03 +13:00
Robbie Averill
100be38ab1 API Remove use of getEscapedTitle() and deprecated for future removal. Use $Title directly instead. 2018-03-22 09:24:55 +13:00
Dylan Wagstaff
5b68e7bb58
Merge pull request #739 from creative-commoners/pulls/5.0/bootstrap-alert
Use bootstrap alert instead of old .message.notice
2018-03-21 12:18:06 +13:00
Robbie Averill
029a69b937 FIX Do not convert right title to XML, templates escape values by default now 2018-03-21 11:57:30 +13:00
Robbie Averill
df1d428df8 Use bootstrap alert instead of old .message.notice 2018-03-21 10:49:13 +13:00
Robbie Averill
d19914044a FIX getFormParent does not automatically look up arbitrary test stubs, remove theme dependency 2018-03-19 16:00:57 +13:00
Dylan Wagstaff
48bf46215e FIX stop form items double duplicating (#728)
When calling `duplicate` on a form, a form field, or suchlike, the results
would be that all related items to the thing being duplicated (such as
fields for a form, or options to an editabledropdown) would be duplicated
_twice_; ie. where a form had two fields, it's new duplicate would have
four (each one occurring twice). We have stopped this in a backwards
compatible way - that is the bug was introduced with core 4.1, and this
change leaves the userforms module compatible with 4.0.
2018-03-05 14:31:33 +13:00
Andrew Aitken-Fincham
e2066a55b3 missing 'not', add alert-warning for unsaved form 2018-02-20 14:44:31 +00:00
Andrew Aitken-Fincham
bc5c6221f0 refactor how getCMSFields is built to handle no parent form 2018-02-20 11:45:45 +00:00
Dylan Wagstaff
20570ef108
Merge pull request #717 from creative-commoners/pulls/5.0/better_email_recipient_logic
adds logic for presence of email recipient fields
2018-02-15 10:41:27 +13:00
Andrew Aitken-Fincham
201282874f revert UDF has_one to DO has_one 2018-02-14 15:02:27 +00:00
Andrew Aitken-Fincham
0f6efea12a add proper fallbacks to cover tests 2018-02-14 11:30:35 +00:00
Andrew Aitken-Fincham
8c34519644 adds logic for presence of email recipient fields 2018-02-13 16:24:53 +00:00
Andrew Aitken-Fincham
579028982c fall back to CMSMain rather than LeftAndMain to getFormParent correctly 2018-02-13 14:41:38 +00:00
Robbie Averill
fa249dd09f Merge branch '4' 2018-02-05 12:10:50 +13:00
Robbie Averill
7339c1c498 FIX Update display rules not enabled warning message to be full width 2018-02-02 12:58:19 +13:00
Robbie Averill
5695c9585a FIX Email templates for for submissions display correctly in preview 2018-01-24 15:17:03 +13:00
Robbie Averill
262510a450 FIX Cast template values as array, include list in CMS fields for recipients 2017-12-04 23:45:52 +13:00
Will Rossiter
e82dc5f121 Update default email_template_directory
Also if the overridded directory is empty - don’t display the template dropdown as this will cause a validation error preventing the user from saving the page.
2017-12-04 23:27:12 +13:00