joycopper007joycopper007 MitgliedKommentare: 1 Danke erhalten: 0 Mitglied seit: November 2016

I've created this event to validate our plugin and it 's working fine with our plugin but when i am trying to save other plugin "PayPal" configuration, i am getting "Form PayPal could not be saved" error msg, so how i can prevent to call "validateForm" this function to other form submit event.

//Event which I've created in bootstrap file
$this->subscribeEvent('Shopware_Controllers_Backend_Config_Before_Save_Config_Element', 'validateForm');  

1 Antwort

  • Daniel NögelDaniel Nögel ModeratorKommentare: 1523 Danke erhalten: 360 Mitglied seit: September 2012

    Hi,

    actually this is a little tricky, as the event does not hold any information, which plugin is currently being checked. So in your case I'd recomment to create a whitelist of elements, that should be checked. If the current element is not in your whitelist, you can just ignore it in your callback. If the element is in the whitelist, you can validate it. 

    Could that be a solution for you?

    Zitieren
    Akzeptierte Antwort
  • Akzeptierte Antwort
Anmelden oder Registrieren, um zu kommentieren.