Skip to content

Commit 9fda4dd

Browse files
committed
Oh, I had form fields with the same name as the containers they were in, nice!
Fixes issues like "Call to an undefined method Nette\Forms\Container|Nette\Forms\Controls\SelectBox::getControl()." and "Call to an undefined method Nette\Forms\Container|Nette\Forms\Controls\TextInput::getControl()."
1 parent c7eeb84 commit 9fda4dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

site/app/Admin/Presenters/templates/Pulse/passwordsStorages.latte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<table>
6262
{formContainer new}
6363
<tr>
64-
<th>{label algo /}</th><td class="short">{input algo}</td>
64+
<th>{label algoName /}</th><td class="short">{input algoName}</td>
6565
<th>{label salted: /}</th><td>{input salted:}</td>
6666
</tr>
6767
<tr>
@@ -83,7 +83,7 @@
8383
<tbody id="newdisclosure-{$i}" n:class="$i != 0 ? hidden">
8484
{formContainer new}
8585
{formContainer "$i"}
86-
<tr><th>{label disclosure /}</th><td>{input disclosure}</td></tr>
86+
<tr><th>{label disclosureType /}</th><td>{input disclosureType}</td></tr>
8787
<tr><th>{label url /}</th><td>{input url}</td></tr>
8888
<tr><th>{label archive /}</th><td>{input archive}</td></tr>
8989
<tr><th>{label note /}</th><td>{input note}</td></tr>

site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function create(callable $onSuccess, int $newDisclosures): Form
105105
$algoContainer->addText('attributes', 'Attributes:');
106106
$algoContainer->addText('note', 'Algorithm note:');
107107
$newAlgoContainer = $algoContainer->addContainer('new');
108-
$inputAlgo = $newAlgoContainer->addText('algo', 'Algorithm:');
108+
$inputAlgo = $newAlgoContainer->addText('algoName', 'Algorithm:');
109109
$inputAlias = $newAlgoContainer->addText('alias', 'Alias:');
110110
$newAlgoContainer->addCheckbox('salted', 'Salted:');
111111
$newAlgoContainer->addCheckbox('stretched', 'Stretched:');
@@ -129,7 +129,7 @@ public function create(callable $onSuccess, int $newDisclosures): Form
129129
$disclosureNewContainer = $disclosureContainer->addContainer('new');
130130
for ($i = 0; $i < $newDisclosures; $i++) {
131131
$disclosureNewCountContainer = $disclosureNewContainer->addContainer($i);
132-
$selectDisclosure = $disclosureNewCountContainer->addSelect('disclosure', 'Disclosure:', $items)
132+
$selectDisclosure = $disclosureNewCountContainer->addSelect('disclosureType', 'Disclosure:', $items)
133133
->setPrompt('- select disclosure type -');
134134
$inputUrl = $disclosureNewCountContainer->addText('url', 'URL:')
135135
->setHtmlType('url');

site/app/Pulse/Passwords.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,12 @@ public function addStorage(ArrayHash $values): bool
464464
? $values->site->id // the value can also be "all"
465465
: $this->sites->add($newSite->url, $newSite->alias, $newSite->sharedWith, $companyId)
466466
);
467-
$algoId = (empty($newAlgo->algo) ? (int)$values->algo->id : $this->addAlgorithm($newAlgo->algo, $newAlgo->alias, $newAlgo->salted, $newAlgo->stretched));
467+
$algoId = (empty($newAlgo->algoName) ? (int)$values->algo->id : $this->addAlgorithm($newAlgo->algoName, $newAlgo->alias, $newAlgo->salted, $newAlgo->stretched));
468468
foreach ($values->disclosure->new as $disclosure) {
469469
if ($disclosure->url) {
470470
$disclosureId = $this->getDisclosureId($disclosure->url, $disclosure->archive);
471471
if (!$disclosureId) {
472-
$disclosureId = $this->addDisclosure($disclosure->disclosure, $disclosure->url, $disclosure->archive, $disclosure->note, $disclosure->published);
472+
$disclosureId = $this->addDisclosure($disclosure->disclosureType, $disclosure->url, $disclosure->archive, $disclosure->note, $disclosure->published);
473473
}
474474
$storageId = $this->getStorageId($companyId, $algoId, $siteId, $values->algo->from, $values->algo->fromConfirmed, $values->algo->attributes, $values->algo->note);
475475
if (!$storageId) {

0 commit comments

Comments
 (0)