diff --git a/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php
index bef6e3072..61665e0d1 100644
--- a/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php
+++ b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php
@@ -75,12 +75,15 @@ public function display(int $petitionId): void
{
$vv_enrollment_atttributes_ids = Hash::extract($this->vv_obj->petition_attributes, '{n}.enrollment_attribute_id');
$vv_enrollment_atttributes_ids = array_unique($vv_enrollment_atttributes_ids);
+ $vv_enrollment_attributes = [];
- $vv_enrollment_attributes = $this->fetchTable('EnrollmentAttributes')
- ->find()
- ->where(fn(QueryExpression $exp, Query $q) => $exp->in('id', $vv_enrollment_atttributes_ids))
- ->order(['ordr' => 'ASC'])
- ->toArray();
+ if (!empty($vv_enrollment_atttributes_ids)) {
+ $vv_enrollment_attributes = $this->fetchTable('EnrollmentAttributes')
+ ->find()
+ ->where(fn(QueryExpression $exp, Query $q) => $exp->in('id', $vv_enrollment_atttributes_ids))
+ ->order(['ordr' => 'ASC'])
+ ->toArray();
+ }
$this->set('vv_enrollment_attributes', $vv_enrollment_attributes);
$this->set('vv_step', $this->vv_step);
diff --git a/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php b/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
index e2d44c602..b59a82a41 100644
--- a/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
+++ b/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
@@ -31,6 +31,13 @@
declare(strict_types = 1);
+if (empty($vv_enrollment_attributes)) {
+ print $this->element('emptyPetitionFlowStep', [], [
+ 'cache' => '_html_elements',
+ ]);
+ return;
+}
+
?>
diff --git a/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php b/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php
index a3bf4d13b..4367b3181 100644
--- a/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php
+++ b/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php
@@ -33,21 +33,27 @@
use App\Lib\Enum\VerificationMethodEnum;
+if (empty($vv_pv)) {
+ print $this->element('emptyPetitionFlowStep', [], [
+ 'cache' => '_html_elements',
+ ]);
+ return;
+}
+
?>
-
-
-
- - = $pv->mail ?>:
- verification) && $pv->verification->isVerified()): ?>
- = __d('result', 'Verifications.status', [
- VerificationMethodEnum::getLocalization($pv->verification->method),
- $this->Time->nice($pv->verification->verification_time, $viewVars["vv_tz"])
- ]) ?>
-
- = __d('field','unverified') ?>
-
-
-
-
-
\ No newline at end of file
+
+
+
+ - = $pv->mail ?>:
+ verification) && $pv->verification->isVerified()): ?>
+ = __d('result', 'Verifications.status', [
+ VerificationMethodEnum::getLocalization($pv->verification->method),
+ $this->Time->nice($pv->verification->verification_time, $viewVars["vv_tz"])
+ ]) ?>
+
+ = __d('field','unverified') ?>
+
+
+
+
\ No newline at end of file
diff --git a/app/src/Controller/ApiV2Controller.php b/app/src/Controller/ApiV2Controller.php
index a9197be5c..dbe6d3417 100644
--- a/app/src/Controller/ApiV2Controller.php
+++ b/app/src/Controller/ApiV2Controller.php
@@ -77,7 +77,7 @@ public function initialize(): void {
public function add() {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -180,7 +180,7 @@ public function calculateRequestedCOID(): ?int {
public function delete($id) {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -230,7 +230,7 @@ protected function dispatchIndex(string $mode = 'default') {
}
// $modelsName = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -260,7 +260,7 @@ protected function dispatchIndex(string $mode = 'default') {
public function edit($id) {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -380,7 +380,7 @@ public function index() {
public function view($id = null) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php
index 07c27cd42..252c1a239 100644
--- a/app/src/Controller/AppController.php
+++ b/app/src/Controller/AppController.php
@@ -166,7 +166,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
public function beforeRender(\Cake\Event\EventInterface $event) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// Views can also inspect the request object to determine the current
// controller and action, but it seems slightly easier to do it once here.
@@ -223,7 +223,7 @@ public function getCOID(): ?int {
protected function primaryLinkOnGet(string $potentialPrimaryLink): Object|bool
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// If this action allows unkeyed, asserted primary link IDs, check the query
// string (e.g.: 'add' or 'index' allow matchgrid_id to be passed in)
@@ -257,7 +257,7 @@ protected function primaryLinkOnGet(string $potentialPrimaryLink): Object|bool
protected function primaryLinkOnPost(string $potentialPrimaryLink): Object|bool
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// Post = add, where we can have a list of objects and nothing in /objects/{id}
// We don't support different primary links across objects, so we throw an error
@@ -290,7 +290,7 @@ protected function primaryLinkOnPost(string $potentialPrimaryLink): Object|bool
protected function primaryLinkOnPut(): Object|bool
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$param = (int)$this->request->getParam('pass.0');
// Put = edit, so we should look up the parent ID via the object itself
@@ -313,7 +313,7 @@ protected function primaryLinkOnPut(): Object|bool
protected function populatedPrimaryLink(string $potentialPrimaryLink): Object
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $potentialPrimaryLink will be something like 'attribute_collector_id'
// $potentialPrimaryLinkTable will be something like 'CoreEnroller.AttributeCollectors'
$potentialPrimaryLinkTable = $this->$modelsName->getPrimaryLinkTableName($potentialPrimaryLink);
@@ -351,7 +351,7 @@ protected function populatedPrimaryLink(string $potentialPrimaryLink): Object
protected function primaryLinkLookup(): void
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$availablePrimaryLinks = $this->$modelsName->getPrimaryLinks();
// Iterate over all the potential primary links and pick the appropriate one
@@ -423,7 +423,7 @@ public function getPrimaryLink(bool $lookup=false): Object
}
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$this->cur_pl = new \stdClass();
@@ -485,7 +485,7 @@ public function getPrimaryLink(bool $lookup=false): Object
protected function getRedirectGoal(string $action): ?string {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// PrimaryLinkTrait
if(method_exists($this->$modelsName, "getRedirectGoal")) {
@@ -608,7 +608,7 @@ protected function setCO() {
if(!$coid) {
// $this->name = Models, unless we're in an API call
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$attrs = $this->request->getAttributes();
@@ -718,7 +718,7 @@ protected function setCO() {
protected function setTZ() {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// See if we've collected it from the browser in a previous page load. Otherwise,
// use the system default. If the user set a preferred timezone, we'll catch that below.
diff --git a/app/src/Controller/MVEAController.php b/app/src/Controller/MVEAController.php
index 4a7ec6507..4f25a06be 100644
--- a/app/src/Controller/MVEAController.php
+++ b/app/src/Controller/MVEAController.php
@@ -46,7 +46,7 @@ class MVEAController extends StandardController {
public function beforeFilter(\Cake\Event\EventInterface $event) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
if(!$this->request->is('restful') && $this->request->getParam('action') != 'deleted') {
// Provide additional hints to BreadcrumbsComponent. This needs to be here
@@ -139,7 +139,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
public function beforeRender(\Cake\Event\EventInterface $event) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// field = model (or model_name)
$fieldName = Inflector::underscore(Inflector::singularize($modelsName));
diff --git a/app/src/Controller/StandardController.php b/app/src/Controller/StandardController.php
index 4d5844905..1c83bb920 100644
--- a/app/src/Controller/StandardController.php
+++ b/app/src/Controller/StandardController.php
@@ -57,7 +57,7 @@ class StandardController extends AppController {
public function add() {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -176,7 +176,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
// XXX can we merge calls ot (eg) getPrimaryLink and populateAutoViewVars here?
public function beforeRender(\Cake\Event\EventInterface $event) {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -241,7 +241,7 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
public function delete($id) {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -329,7 +329,7 @@ public function delete($id) {
public function deleted() {
// Set the title when not set at the individual controller
if(empty($this->viewBuilder()->getVar('vv_title'))) {
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$fieldName = Inflector::singularize($modelsName);
if(__d('result', $fieldName . '.deleted') != $fieldName . '.deleted') {
// Use the standard (singular) deleted message for the field when it exists
@@ -357,7 +357,7 @@ public function deleted() {
public function edit(string $id) {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -569,7 +569,7 @@ public function generateRedirect($entity) {
protected function getFieldTypes() {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -592,7 +592,7 @@ protected function getFieldTypes() {
protected function getRequiredFields() {
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -619,7 +619,7 @@ protected function getRequiredFields() {
public function index() {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -660,7 +660,7 @@ public function index() {
protected function populateAutoViewVars(object $obj=null) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -681,7 +681,7 @@ protected function populateAutoViewVars(object $obj=null) {
public function provision($id) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
@@ -726,7 +726,7 @@ public function provision($id) {
public function unfreeze($id) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -757,7 +757,7 @@ public function unfreeze($id) {
public function view($id = null) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// $tableName = models
diff --git a/app/src/Controller/StandardEnrollerController.php b/app/src/Controller/StandardEnrollerController.php
index ebe7b4446..f286befc6 100644
--- a/app/src/Controller/StandardEnrollerController.php
+++ b/app/src/Controller/StandardEnrollerController.php
@@ -116,7 +116,7 @@ public function calculatePermission(): bool {
if($action == 'dispatch') {
// We already validated the petition state in willHandleAuth
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$modelId = $this->request->getParam('pass.0'); // XXX check if empty
if(!$modelId) {
@@ -212,7 +212,7 @@ public function willHandleAuth(\Cake\Event\EventInterface $event): string {
// For this, we need the current step's authorization.
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
$modelId = $this->request->getParam('pass.0');
if(empty($modelId)) {
diff --git a/app/src/Controller/StandardPluggableController.php b/app/src/Controller/StandardPluggableController.php
index e8f33c287..b49a6f735 100644
--- a/app/src/Controller/StandardPluggableController.php
+++ b/app/src/Controller/StandardPluggableController.php
@@ -47,7 +47,7 @@ public function configure(string $id) {
// potentially many times on an index view for links that may not be used.)
// $this->name = Models (ie: from ModelsTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
diff --git a/app/src/Controller/StandardPluginController.php b/app/src/Controller/StandardPluginController.php
index 27def58d4..ca444f542 100644
--- a/app/src/Controller/StandardPluginController.php
+++ b/app/src/Controller/StandardPluginController.php
@@ -47,7 +47,7 @@ class StandardPluginController extends StandardController {
public function beforeFilter(\Cake\Event\EventInterface $event) {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
if(!$this->request->is('restful')) {
// Provide additional hints to BreadcrumbsComponent. This needs to be here
@@ -83,7 +83,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
public function beforeRender(\Cake\Event\EventInterface $event) {
// $this->name = Models (ie: from ModelsTable, eg FileProvisionersTable)
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
diff --git a/app/src/Lib/Traits/IndexQueryTrait.php b/app/src/Lib/Traits/IndexQueryTrait.php
index 0a3e9fb76..690d97ef9 100644
--- a/app/src/Lib/Traits/IndexQueryTrait.php
+++ b/app/src/Lib/Traits/IndexQueryTrait.php
@@ -45,7 +45,7 @@ trait IndexQueryTrait {
*/
public function constructGetIndexContains(Query $query): object {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// Initialize the containClause
@@ -74,7 +74,7 @@ public function constructGetIndexContains(Query $query): object {
*/
public function constructGetPickerContains(Query $query): object {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// Initialize the containClause
@@ -105,7 +105,7 @@ public function constructGetPickerContains(Query $query): object {
public function containClauseFromQueryParams(): array
{
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
@@ -154,7 +154,7 @@ public function containClauseFromQueryParams(): array
*/
public function getIndexQuery(bool $pickerMode = false, array $requestParams = []): object {
// $this->name = Models
- $modelsName = $this->name;
+ $modelsName = $this->getName();
// $table = the actual table object
$table = $this->$modelsName;
// PrimaryLinkTrait
diff --git a/app/templates/EnrollmentFlows/start.inc b/app/templates/EnrollmentFlows/start.inc
index 446ef0a98..9e6a152da 100644
--- a/app/templates/EnrollmentFlows/start.inc
+++ b/app/templates/EnrollmentFlows/start.inc
@@ -28,7 +28,7 @@
declare(strict_types = 1);
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $tablename = models
$tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name));
// Table Reference
diff --git a/app/templates/ExternalIdentitySources/search.php b/app/templates/ExternalIdentitySources/search.php
index fb943f460..8b26d1850 100644
--- a/app/templates/ExternalIdentitySources/search.php
+++ b/app/templates/ExternalIdentitySources/search.php
@@ -28,7 +28,7 @@
declare(strict_types = 1);
// Required by the subnavigation partial
-$modelsName = $this->name;
+$modelsName = $this->getName();
// Subnavigation calculations
if(file_exists(ROOT . DS . 'templates' . DS . 'Standard/subnavigation.inc')) {
include(ROOT . DS . 'templates' . DS . 'Standard/subnavigation.inc');
diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php
index a4dceac6c..7da8b303c 100644
--- a/app/templates/Standard/add-edit-view.php
+++ b/app/templates/Standard/add-edit-view.php
@@ -29,7 +29,7 @@
//$action = $this->template;
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $tablename = models
// XXX backport to match?
$tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name));
diff --git a/app/templates/Standard/deleted.php b/app/templates/Standard/deleted.php
index 1642d95c3..aeb1f64ce 100644
--- a/app/templates/Standard/deleted.php
+++ b/app/templates/Standard/deleted.php
@@ -28,7 +28,7 @@
declare(strict_types = 1);
-$modelsName = $this->name;
+$modelsName = $this->getName();
$tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name));
// $vv_template_path will be set for plugins
diff --git a/app/templates/Standard/dispatch.php b/app/templates/Standard/dispatch.php
index be78db43f..3f923e456 100644
--- a/app/templates/Standard/dispatch.php
+++ b/app/templates/Standard/dispatch.php
@@ -28,7 +28,7 @@
declare(strict_types = 1);
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $tablename = models
$tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name));
diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php
index 1d07fe396..cb7b793b3 100644
--- a/app/templates/Standard/index.php
+++ b/app/templates/Standard/index.php
@@ -36,7 +36,7 @@
use \Cake\Utility\Inflector;
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $tablename = models
// XXX backport to match?
$tableName = Inflector::tableize(Inflector::singularize($this->name));
diff --git a/app/templates/element/bulk/bulk.php b/app/templates/element/bulk/bulk.php
index 08633b227..f3549155e 100644
--- a/app/templates/element/bulk/bulk.php
+++ b/app/templates/element/bulk/bulk.php
@@ -44,7 +44,7 @@
use \Cake\Utility\Inflector;
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $tablename = models
// XXX backport to match?
$tableName = Inflector::tableize($this->name);
diff --git a/app/templates/element/filter/dateSingle.php b/app/templates/element/filter/dateSingle.php
index 1230fad0b..9c920a817 100644
--- a/app/templates/element/filter/dateSingle.php
+++ b/app/templates/element/filter/dateSingle.php
@@ -43,7 +43,7 @@
// $columns = the passed parameter $indexColumns as found in columns.inc;
// provides overrides for labels and sorting.
$columns = $vv_indexColumns;
-$modelsName = $this->name;
+$modelsName = $this->getName();
$label = Inflector::humanize(
Inflector::underscore(
diff --git a/app/templates/element/filter/default.php b/app/templates/element/filter/default.php
index ca1b4ced7..14e62759d 100644
--- a/app/templates/element/filter/default.php
+++ b/app/templates/element/filter/default.php
@@ -40,7 +40,7 @@
// $columns = the passed parameter $indexColumns as found in columns.inc; provides overrides for labels and sorting.
$columns = $vv_indexColumns;
-$modelsName = $this->name;
+$modelsName = $this->getName();
$label = Inflector::humanize(
Inflector::underscore(
diff --git a/app/templates/element/filter/filter.php b/app/templates/element/filter/filter.php
index a6c94022b..66bda5d3e 100644
--- a/app/templates/element/filter/filter.php
+++ b/app/templates/element/filter/filter.php
@@ -48,7 +48,7 @@
use Cake\Utility\Inflector;
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
// $modelName = Model
$modelName = Inflector::singularize($modelsName);
diff --git a/app/templates/element/filter/options.php b/app/templates/element/filter/options.php
index 876613f56..771327e85 100644
--- a/app/templates/element/filter/options.php
+++ b/app/templates/element/filter/options.php
@@ -29,7 +29,7 @@
use App\Lib\Enum\ApplicationStateEnum;
-$modelsName = $this->name;
+$modelsName = $this->getName();
?>
diff --git a/app/templates/element/filter/peoplePicker.php b/app/templates/element/filter/peoplePicker.php
index d6164cad0..4d24dd9f1 100644
--- a/app/templates/element/filter/peoplePicker.php
+++ b/app/templates/element/filter/peoplePicker.php
@@ -40,7 +40,7 @@
// $columns = the passed parameter $indexColumns as found in columns.inc; provides overrides for labels and sorting.
$columns = $vv_indexColumns;
-$modelsName = $this->name;
+$modelsName = $this->getName();
$label = Inflector::humanize(
Inflector::underscore(
diff --git a/app/templates/element/subnavigation/navBar.php b/app/templates/element/subnavigation/navBar.php
index 6f4268e58..c0e8630b1 100644
--- a/app/templates/element/subnavigation/navBar.php
+++ b/app/templates/element/subnavigation/navBar.php
@@ -42,7 +42,7 @@
extract($subNavAttributes, EXTR_PREFIX_ALL, 'vv_subnavigation');
// $this->name = Models
-$modelsName = $this->name;
+$modelsName = $this->getName();
$fullModelsName = !empty($this->getPlugin()) ? $this->getPlugin() . '.' . $modelsName : $modelsName;
?>