Skip to content

Commit

Permalink
Fix EmailVerifier rendering (CFM-333)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 13, 2025
1 parent 79e662d commit 60eedb6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
$this->set('vv_bc_parent_primarykey', $this->EmailVerifiers->EnrollmentFlowSteps->getPrimaryKey());
}

if ($this->getRequest()->getQuery("op") == "verify" || $this->getRequest()->getQuery("op") == "index") {
// We use the viewvar to determine the op since 'index' isn't always present
$op = $this->viewBuilder()->getVar('vv_op');

if($op == "verify" || $op == "index") {
// This will suppress the default behavior. By default, we print the submit button in the
// unorderedList.php element. But for the verify view we want to override and customize
$this->set('suppress_submit', true);
Expand All @@ -80,9 +83,8 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
* @return void
* @since COmanage Registry v5.1.0
*/
public function resend($id)
{


public function resend($id) {
$this->viewBuilder()->setClassName('Json');

if (!$this->getRequest()->is('ajax')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<th><?= __d('field', 'status') ?></th>
</tr>
</thead>
</tbody>

<tbody>
<?php foreach(array_keys($vv_email_addresses) as $addr): ?>
<?php
$verified = isset($vv_verified_addresses[$addr]) && $vv_verified_addresses[$addr];
Expand Down Expand Up @@ -111,17 +111,16 @@
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

<?php

if($vv_minimum_met || count($vv_email_addresses) === 0) {
$this->Field->enableFormEditMode();

print $this->Form->hidden('op', ['default' => 'finish']);

print $this->element('form/submit', ['label' => $vv_submit_button_label]);
}
?>
<?php endforeach; ?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'code',
'fieldLabel' => "Code", //__d('field', 'mail')
'fieldLabel' => __d('field', 'code'),
'fieldOptions' => [
'required' => true
]
Expand Down
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/field.po
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ msgstr "Area Code"
msgid "attribute"
msgstr "Attribute"

msgid "code"
msgstr "Code"

msgid "comment"
msgstr "Comment"

Expand Down
1 change: 0 additions & 1 deletion app/templates/element/form/submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/


declare(strict_types = 1);
?>

Expand Down

0 comments on commit 60eedb6

Please sign in to comment.