Exception Malformed temp table category on New A/B Test
Overview
When I create new A/B Test I receive error in session status Exception Malformed temp table
Reproduction steps
- Create any new A/B Test
- on final step click on Submit Mailing
- Error Exception Malformed temp table is displayed
Current behaviour
There is a problem with length of $category, which for this case is a variable
// CRM/Mailing/BAO/Recipients.php
->setCategory('srcmailing' . $sourceMailingId)
For mailing_id greater than 99 (sic!) the generated category is invalid due to this check (CATEGORY_LENGTH
is equal only 12):
// CRM/Utils/SQL/TempTable.php
public function setCategory($category) {
if ($category && !preg_match(self::CATEGORY_REGEXP, $category) || strlen($category) > self::CATEGORY_LENGTH) {
CRM_Core_Error::backtrace();
throw new \RuntimeException("Malformed temp table category");
}
$this->category = $category;
return $this;
}
Expected behaviour
We should create category for max of INT(10) UNSIGNED, so it should be srcmailing4294967295
char(20) or shorter prefix. Probably in both situation we need to increase self::CATEGORY_LENGTH
Environment information
- CiviCRM: 5.21.1