Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
newbie LAC Posted April 4, 2017 Posted April 4, 2017 Hello, Widget settings validation doesn't work. Code public function configuration( &$form=null ) { if ($form === null) { $form = new \IPS\Helpers\Form; } $form->add( new \IPS\Helpers\Form\Text( 'custom_validate', isset($this->configuration['custom_validate']) ? $this->configuration['custom_validate'] : null, false, array(), function($val) { if ($val == 'bad') { throw new \InvalidArgumentException('form_bad_value'); } } ) ); $form->add( new \IPS\Helpers\Form\Text( 'required_field', isset($this->configuration['required_field']) ? $this->configuration['required_field'] : null, true, array() ) ); return $form; } I changed in applications/core/modules/front/system/widgets.php from \IPS\Output::i()->sendOutput( $widget->configuration()->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'widgets', 'core' ) ), 'formTemplate' ), $widget ) ); to \IPS\Output::i()->output = $widget->configuration()->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'widgets', 'core' ) ), 'formTemplate' ), $widget ); Result
bfarber Posted April 4, 2017 Posted April 4, 2017 Thank you for bringing this to our attention. I've logged an internal bug report and we will take a look.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.