mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
ID can be used to validate object
This commit is contained in:
parent
124d3761ee
commit
b3af63e387
@ -34,6 +34,7 @@ class FormSpamProtectionExtension extends Extension {
|
|||||||
* @var array $mappable_fields
|
* @var array $mappable_fields
|
||||||
*/
|
*/
|
||||||
private static $mappable_fields = array(
|
private static $mappable_fields = array(
|
||||||
|
'id',
|
||||||
'title',
|
'title',
|
||||||
'body',
|
'body',
|
||||||
'contextUrl',
|
'contextUrl',
|
||||||
@ -84,6 +85,8 @@ class FormSpamProtectionExtension extends Extension {
|
|||||||
|
|
||||||
// add the form field
|
// add the form field
|
||||||
if($field = $protector->getFormField($name, $title)) {
|
if($field = $protector->getFormField($name, $title)) {
|
||||||
|
$field->setForm($this->owner);
|
||||||
|
|
||||||
$this->owner->Fields()->push($field);
|
$this->owner->Fields()->push($field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user