dorsetdigital

As described here: https://forum.silverstripe.org/t/adding-svg-to-the-allowed-files-in-ss4/883

Show 1 attachment(s)
Silverstripe Forum  
Adding SVG to the allowed files in SS4

This one comes up quite a lot on the Slack channel, so I thought it was worth a post here as well. The below is specific to SVG files, but the same techniques apply to other extensions. The first thing to note is that, contrary to what your instinct might think, an SVG isn’t an image file. In SilverStripe, images are bitmap-style files such as jpg, gif, png, etc. and when you use them, you get all kinds of extra manipulation classes. Because of this, SVG files needs to be stored in File ...

Hide attachment content
firesphere

Hmmm, how can I add a file type to the allowed filetypes .htaccess in assets?

null

I have a form with a CheckboxSetField that I need to be ticked before submission, so I've added it to RequiredFields. But no matter what I do, it always seems to fail the validator. Any ideas what I'm doing wrong?

  1. $myForm = Form::create(
  2. $this->owner,
  3. 'MyForm',
  4. $fields = FieldList::create([
  5. ...
  6. CheckboxField::create('ConsentObtained', $consentObtainedLabel)
  7. ]),
  8. $actions = FieldList::create([...]),
  9. $validator = RequiredFields::create([
  10. ...
  11. 'ConsentObtained',
  12. ])
  13. );
null

($consentObtainedLabel is a string loaded from the CMS)

null

Strangely enough, error message shown it isn't 'ConsentObtained' is required. It's 'The value of my CMS string' is required

null

heh, if I pass $consentObtainedLabel into the RequiredFields constructor instead, it does pass. lol

null

Found it... was in my template override to http://CheckboxField.ss ... the value was hardcoded to 0 😄

null

Hrm... no, still not it! It seems RequiredFields is not seeing data for the ConsentObtained field

firesphere

For some reason, emails from the CMS always look in the application folder, maybe that's the problem?

Ryan Duncan

Hello, having a bit of an issue with the userforms module. I'm trying to use a custom email template and have added the code:

  1. SilverStripe\UserForms\Model\UserDefinedForm:
  2. email_template_directory: app/templates/custom_userforms_emails
into my config.yml file. The template shows up correctly in the email template drop down but when the email is sent it defaults back to the original template.

I'm getting the error:

  1. None of the following templates could be found: tes/custom_userforms_emails/Test in themes
and the directory I have the templates in is:
  1. app/templates/custom_userforms_emails
for some reason it is cut off in the error.

I've tried dev/build and flushing multiple times, also tried removing the thememanifest cache (was mentioned on a previous bug post on github) but nothing has worked for me.

Has anyone had anything similar? Cheers!

sander_ha

If I have an Image object, is there a way to get access to the Interventation library methods through it?

rista

only I need to do some things based on the get param

rista

so actually my bad, it can redirect to where it is going now