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

Commit

Permalink
Fixed table alias to render proper value label for dropdowns for rela…
Browse files Browse the repository at this point in the history
…ted records - task #9315
  • Loading branch information
stepanov committed Jan 15, 2019
1 parent c973b7c commit 8f9e3d7
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 8f9e3d7

Please sign in to comment.