Skip to content

Commit

Permalink
FORSLAG-107: Fixed length of temp store key
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Aug 29, 2023
1 parent 9ce2b2f commit 3f3d417
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,16 @@ public function saveSurveyResponse(WebformInterface $webform, ContentEntityInter

/**
* Create temp store key.
*
* This key will have a user id prepended before being stored in the database
* table key_value_expire. The key name in this table allows at most 128
* character and for anonymous users a random session id with a length around
* 43 will be prepended (cf. Drupal\Core\TempStore\PrivateTempStore::set()).
* A webform id can be at most 32 characters which leaves us with at most
* 128-43-32 = 53 characters for our key prefix.
*/
private function createTempStoreKey(WebformInterface $webform): string {
return self::class . '_' . $webform->id();
return 'citizen_proposal_webform:' . $webform->id();
}

/**
Expand Down

0 comments on commit 3f3d417

Please sign in to comment.