jakx

(I don't want to use UploadField, because I don't want the file to be written to the filesystem)

jakx

I notice that the request headers for the form submission don't have multipart/form-data in the content-type, so I'm wondering if there's something I need to do so the file data will be captured

jakx

Has anyone here ever managed to add a FileField to MyPage::getCMSFields() and handled the File data? Kind of like ModelAdmin import, but with the SiteTree edit form.

jakx

During a GridField request for an GridField_ActionProvider, is there a clever way to trigger a toaster popup AND respond with the markup for the GridField state?

I'm trying to warn the user and keep the GridField state as it was before they attempted the action. Right now if I do something i.e

  1. public function handleAction()
  2. {
  3. throw new ValidationException('Foo bar');
  4. }

The browser reacts to the 403 ("An error occurred while fetching..."), then a toaster popup appears ("Validation error: Foo bar"), and the GridField state breaks (No records)

Mo

I believe you can do this by adding a header to the response that tells SS to display a message, I could be wrong though.

jakx

Seems to have been resolved, I suspect it was something local to the test that was running at the time that the error was triggered

jakx

https://slackarchive.silverstripe.org/slack-archive/message/265283#msg_265283 @Mo did you ever get to the bottom of this?

i.e

  1. Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

I'm having the same issue at the moment

Show 3 attachment(s)
slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

Hide attachment content
jakx
jakx in #ss4 2019-09-06 07:02:05 (edited) (deleted)

What about the injector causes it to throw a Cannot declare class Vendor\\App\\Security\\MyAuthenticationHandler, because the name is already in use error?

e.g

  1. ---
  2. Name: mycoreauthentication
  3. After:
  4. - '#coreauthentication'
  5. ---
  6. SilverStripe\Core\Injector\Injector:
  7. SilverStripe\Security\AuthenticationHandler:
  8. class: Vendor\App\Security\MyAuthenticationHandler
jakx

Though it's not always applicable, because ->write() doesn't return the object instance, just the ID

jakx

I lean towards the former too, to me it feels more elegant and somehow more SS "flavoured"

👍 (1)