Render test code on rule save

Created on 21 December 2023, 6 months ago
Updated 4 June 2024, 25 days ago

on save (edit) rule /admin/config/content/customfilter/filter/test screen render test-code

editArray ( [rid] => test_rule [prid] => [fid] => test [name] => test rule [description] => [enabled] => 1 [matches] => [pattern] => /<\/p>(.*?)

return $result = 'REPLACE WITH'; [code] => 1 [weight] => 0 ) Redirecting to http://example.com/admin/config/content/customfilter/filter/test.

Patch customfilter\src\Form\RulesAddEditForm.php public function submitForm(array &$form, FormStateInterface $form_state)

    switch ($form_state->getValue('operation')) {
      case 'edit':
        //print 'edit';
        //print_r($item);
        $this->entity->updateRule($item);
        $this->entity->save();
        break;

      case 'add':
        $this->entity->addRule($item);
        $this->entity->save();
        break;
    }
    $form_state->setRedirect('customfilter.rules.list', ['customfilter' => $form_state->getValue('fid')]);
  }

}
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇱Israel Promo-IL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024