2

Right after the update to CiviCRM 5.33.0, many pages (as civicrm/case/add or civicrm/mailing/browse/scheduled?) throws the following error - QuickForm Error: the rule does not exist as a registered rule Is there a quick fix for this QuickForm ?

There is some details in the logs w/ a xssString :

[debug] $backTrace = #0 /PATH/vendor/civicrm/civicrm-core/CRM/Core/Error.php(205): CRM_Core_Error::backtrace("backTrace", TRUE)

#1 /PATH/vendor/pear/pear-core-minimal/src/PEAR.php(944): CRM_Core_Error::handle(Object(HTML_QuickForm_Error)) 
#2 /PATH/vendor/civicrm/civicrm-core/packages/HTML/QuickForm.php(2107): PEAR_Error->__construct("the rule does not exist as a registered rule", -2, 16, (Array:2), "Rule 'xssString' is not registered in HTML_QuickForm::addRule()")
#3 /PATH/vendor/pear/pear-core-minimal/src/PEAR.php(575): HTML_QuickForm_Error->__construct(-2, 16, (Array:2), "Rule 'xssString' is not registered in HTML_QuickForm::addRule()")
#4 /PATH/vendor/pear/pear-core-minimal/src/PEAR.php(236): PEAR::_raiseError(NULL, NULL, -2, 16, (Array:2), "Rule 'xssString' is not registered in HTML_QuickForm::addRule()", "HTML_QuickForm_Error", TRUE)
#5 /PATH/vendor/civicrm/civicrm-core/packages/HTML/QuickForm.php(1109): PEAR::__callStatic("raiseError", (Array:7))
#6 /PATH/vendor/civicrm/civicrm-core/packages/HTML/QuickForm.php(689): HTML_QuickForm->addRule("title", "Illegal characters in input (potential scripting attack)", "xssString")

`

2 Answers 2

3

@ichi that rule shouldn't be existing anymore because it was removed in 5.33 https://github.com/civicrm/civicrm-packages/commit/148eb5483caa1059d031f11aaf32b391bead1c66 I would suggest applying that patch onto your system and that should fix the problem

3
  • Thank you for your answer @seamus-lee. I tried to apply the patch, but then all the CiviCRm menu collapsed. I am not sure that it is related to the patch ; it might be another issue. So I downgraded CiviCRM to an earlier version w/ the backup. The site is in production so I have no choice for now.
    – Ichi
    Commented Jan 8, 2021 at 6:49
  • Ah ah to reverse w/ a backup didn't work well. So I have to stick w/ CiviCRM 5.33.1 (just see an upgrade overnight). There is is still the issue.
    – Ichi
    Commented Jan 8, 2021 at 12:31
  • This time (CiviCRM 5.33.1) the patch worked well and solved the problem. Tank you @seamus-lee, you saved my day !
    – Ichi
    Commented Jan 8, 2021 at 12:39
0

This error may occur, If you have added any formRule in a custom form in any of your extension(s) .

For example:

$this->addFormRule(array('CRM_Myextension_Form_Myform', 'myFormRule'));

If you have any line(s) like above in your custom form then you need to change that as below:

$this->addFormRule(array($this, 'formRule'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.