@@ -104,27 +104,29 @@ final public function execute(\Magento\Framework\Event\Observer $observer)
104104 }
105105 return ;
106106 }
107- $ module = $ section ->getName ();
108107 $ data = $ this ->info ->load ([$ section ]);
109108
110109 if (!$ section ->validate ($ data )) {
111110 $ groups ['general ' ]['fields ' ]['enabled ' ]['value ' ] = 0 ;
112- $ this ->setLinvFlag ->execute ($ module , 1 );
111+ $ errorMessage = $ data [$ section ->getModule () . '_errorMsg ' ] ?? '' ;
112+ $ this ->setLinvFlag ->execute ($ section ->getName (), 1 , $ errorMessage );
113113 $ request ->setPostValue ('groups ' , $ groups );
114114
115- $ this ->messageManager ->addError (
116- implode (array_reverse (
115+
116+ if (!$ errorMessage ) {
117+ $ errorMessage = implode (array_reverse (
117118 [
118119 '. ' ,'d ' ,'e ' ,'l ' ,'b ' ,'a ' ,'s ' ,'i ' ,'d ' ,' ' ,'y ' ,'l ' ,'l ' ,'a ' ,'c ' ,'i ' ,'t ' ,'a ' ,'m ' ,
119120 'o ' ,'t ' ,'u ' ,'a ' ,' ' ,'n ' ,'e ' ,'e ' ,'b ' ,' ' ,'s ' ,'a ' ,'h ' ,' ' ,'n ' ,'o ' ,'i ' ,'s ' ,'n ' ,
120121 'e ' ,'t ' ,'x ' ,'e ' ,' ' ,'e ' ,'h ' ,'T ' ,' ' ,'. ' ,'d ' ,'i ' ,'l ' ,'a ' ,'v ' ,'n ' ,'i ' ,' ' ,'r ' ,
121122 'o ' ,' ' ,'y ' ,'t ' ,'p ' ,'m ' ,'e ' ,' ' ,'s ' ,'i ' ,' ' ,'y ' ,'e ' ,'K ' ,' ' ,'t ' ,'c ' ,'u ' ,'d ' ,
122123 'o ' ,'r ' ,'P '
123124 ]
124- ))
125- );
125+ ));
126+ }
127+ $ this ->messageManager ->addError ($ errorMessage );
126128 } else {
127- $ this ->setLinvFlag ->execute ($ module , 0 );
129+ $ this ->setLinvFlag ->execute ($ section -> getName () , 0 );
128130 }
129131 }
130132}
0 commit comments