[TYPO3-ect] bananas - question about captcha
Daniel Brüßler
info at -remove-patchworking.de
Fri Feb 9 14:39:04 CET 2007
Hello,
I still have problems with getting the data stored.
$this->selectHashArray is empty, before exec_INSERTquery is called.
++------------------------------------
first I changed this (in form-controller):
--------
$captchaClassName = tx_div::makeInstanceClassName('tx_lib_captcha');
$captcha = new $captchaClassName($this);
if(!$captcha->ok($this->getClassName())) { // same ID as in captchaAction
...
}
--------
to this, so that the insert-function of the model will be called:
--------
$captchaClassName = tx_div::makeInstanceClassName('tx_lib_captcha');
$captcha = new $captchaClassName($this);
if(1==1) {
$modelClassName =
tx_div::makeInstanceClassName('tx_bananas_models_board');
$model = new $modelClassName($this, $validator);
$success = $model->insert();
...
}else{
print '-- data was not stored --';
}
--------
but the insert-function of the model doesn't get the values in $insertArray
----
foreach($this->selectHashArray('title, text, author, email, url') as
$key => $value) {
$insertArray[$key] = htmlspecialchars($value);
}
$insertArray['hidden'] = (integer)
$this->getConfiguration('moderatedSubmits');
$insertArray['tstamp'] = $insertArray['crdate'] = time();
$insertArray['pid'] = (integer)
array_pop(tx_div::toListArray($this->getConfiguration('tt_content.pages')));
$insertArray['url'] = ($insertArray['url'] == 'http://') ? '' :
$insertArray['url'];
--------
this is the content of the array:
--------
Array
(
[title] =>
[text] =>
[author] =>
[email] =>
[url] =>
[hidden] => 0
[crdate] => 1171027264
[tstamp] => 1171027264
[pid] => 32
)
--------
why is $this->selectHashArray is empty?
kind regards
Daniel Brüßler
More information about the TYPO3-team-extension-coordination
mailing list