Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #751 from QoboLtd/wrong-list-labels-in-subpanels-9315
Browse files Browse the repository at this point in the history
Fix table alias to render proper value label for dropdowns for related records (task #9315)
  • Loading branch information
georgeconstantinou committed Jan 15, 2019
2 parents c973b7c + 8f9e3d7 commit 67278fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Event/Controller/Api/BaseActionListener.php
Expand Up @@ -7,6 +7,7 @@
use Cake\Event\EventListenerInterface;
use Cake\ORM\Table;
use Cake\Utility\Hash;
use Cake\Utility\Inflector;
use Cake\View\View;
use CsvMigrations\FieldHandlers\FieldHandlerFactory;
use CsvMigrations\Utility\FileUpload;
Expand Down Expand Up @@ -218,6 +219,8 @@ protected function prettify(EntityInterface $entity, RepositoryInterface $table,
}
}

// Fix alias set by pagination hask
$table->setAlias(Inflector::camelize($table->getTable()));
$entity->set($field, $factory->renderValue($table, $field, $entity->get($field), ['entity' => $entity]));
}
}
Expand Down

0 comments on commit 67278fe

Please sign in to comment.