Skip to content

Commit

Permalink
Oh, I had form fields with the same name as the containers they were …
Browse files Browse the repository at this point in the history
…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()."
  • Loading branch information
spaze committed Jul 17, 2023
1 parent c7eeb84 commit 9fda4dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<table>
{formContainer new}
<tr>
<th>{label algo /}</th><td class="short">{input algo}</td>
<th>{label algoName /}</th><td class="short">{input algoName}</td>
<th>{label salted: /}</th><td>{input salted:}</td>
</tr>
<tr>
Expand All @@ -83,7 +83,7 @@
<tbody id="newdisclosure-{$i}" n:class="$i != 0 ? hidden">
{formContainer new}
{formContainer "$i"}
<tr><th>{label disclosure /}</th><td>{input disclosure}</td></tr>
<tr><th>{label disclosureType /}</th><td>{input disclosureType}</td></tr>
<tr><th>{label url /}</th><td>{input url}</td></tr>
<tr><th>{label archive /}</th><td>{input archive}</td></tr>
<tr><th>{label note /}</th><td>{input note}</td></tr>
Expand Down
4 changes: 2 additions & 2 deletions site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function create(callable $onSuccess, int $newDisclosures): Form
$algoContainer->addText('attributes', 'Attributes:');
$algoContainer->addText('note', 'Algorithm note:');
$newAlgoContainer = $algoContainer->addContainer('new');
$inputAlgo = $newAlgoContainer->addText('algo', 'Algorithm:');
$inputAlgo = $newAlgoContainer->addText('algoName', 'Algorithm:');
$inputAlias = $newAlgoContainer->addText('alias', 'Alias:');
$newAlgoContainer->addCheckbox('salted', 'Salted:');
$newAlgoContainer->addCheckbox('stretched', 'Stretched:');
Expand All @@ -129,7 +129,7 @@ public function create(callable $onSuccess, int $newDisclosures): Form
$disclosureNewContainer = $disclosureContainer->addContainer('new');
for ($i = 0; $i < $newDisclosures; $i++) {
$disclosureNewCountContainer = $disclosureNewContainer->addContainer($i);
$selectDisclosure = $disclosureNewCountContainer->addSelect('disclosure', 'Disclosure:', $items)
$selectDisclosure = $disclosureNewCountContainer->addSelect('disclosureType', 'Disclosure:', $items)
->setPrompt('- select disclosure type -');
$inputUrl = $disclosureNewCountContainer->addText('url', 'URL:')
->setHtmlType('url');
Expand Down
4 changes: 2 additions & 2 deletions site/app/Pulse/Passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ public function addStorage(ArrayHash $values): bool
? $values->site->id // the value can also be "all"
: $this->sites->add($newSite->url, $newSite->alias, $newSite->sharedWith, $companyId)
);
$algoId = (empty($newAlgo->algo) ? (int)$values->algo->id : $this->addAlgorithm($newAlgo->algo, $newAlgo->alias, $newAlgo->salted, $newAlgo->stretched));
$algoId = (empty($newAlgo->algoName) ? (int)$values->algo->id : $this->addAlgorithm($newAlgo->algoName, $newAlgo->alias, $newAlgo->salted, $newAlgo->stretched));
foreach ($values->disclosure->new as $disclosure) {
if ($disclosure->url) {
$disclosureId = $this->getDisclosureId($disclosure->url, $disclosure->archive);
if (!$disclosureId) {
$disclosureId = $this->addDisclosure($disclosure->disclosure, $disclosure->url, $disclosure->archive, $disclosure->note, $disclosure->published);
$disclosureId = $this->addDisclosure($disclosure->disclosureType, $disclosure->url, $disclosure->archive, $disclosure->note, $disclosure->published);
}
$storageId = $this->getStorageId($companyId, $algoId, $siteId, $values->algo->from, $values->algo->fromConfirmed, $values->algo->attributes, $values->algo->note);
if (!$storageId) {
Expand Down

0 comments on commit 9fda4dd

Please sign in to comment.