greg_808

can i use the injector to subclass a class thats declared as final class?

greg_808

Please help me debug my extension. I have a legacy project which uses silverstripe/userforms. I try to use the updateAfterProcess hook in the process methode. But it never gets called. I checked if UserDefinedForm_Controller has the extension with getExtensionInstances. There i see my extension. I have no idea what is going wrong.

  1. class UserDefinedFormExtension extends Extension
  2. {
  3. /**
  4.   * hook into UserDefinedForm process action check if sendNewsletter is true
  5.   * if so register user to MailChimp mailingList
  6.   */
  7.  
  8. public function updateAfterProcess()
  9. {
  10. if ($this->owner->data->sendNewsletter) {
  11. $mail = $this->owner->data->email;
  12. $firstName = $this->owner->data->firstName;
  13. $lastName = $this->owner->data->lastName;
  14. $this->setToMailChimp($mail, $firstName, $lastName);
  15. }
  16. }
  17.  
  18. private function setToMailChimp($mail, $firstName, $lastName)
  19. {
  20. $mailChipService = new UserToMailChimpService($mail, $firstName, $lastName);
  21. $mailChipService->doSubscribeToNewsletter();
  22. }
  23. }
I add the extension like
  1. UserDefinedForm_Controller:
  2. extensions:
  3. - UserDefinedFormExtension
greg_808

In German you always need a sentence for just one english word

greg_808

sorry for OT native English speakers what does

  1. backorder

greg_808

you have to set it

  1. private static $menu_priority = -0.5;