Closed theChaosCoder closed 7 months ago
Please open PRs :)
In TranslationComponent.php Id is always null. $TranslationProjects->getDefaultProjectId() also returns null. Is this correct? (I mean I don't have any projects yet...)
The TranslateStrings->coverage() functions seems to expect an id!?
$coverage = $this->TranslateDomains->TranslateStrings->coverage($this->Translation->currentProjectId());
public function currentProjectId() {
$id = $this->getController()->getRequest()->getSession()->read('TranslateProject.id');
if ($id === null) {
/** @var \Translate\Model\Table\TranslateProjectsTable $TranslationProjects */
$TranslationProjects = TableRegistry::getTableLocator()->get('Translate.TranslateProjects');
$id = $TranslationProjects->getDefaultProjectId();
$this->getController()->getRequest()->getSession()->write('TranslateProject.id', $id);
}
return $id;
}
No you should set up a default project first. Check if docs mention how.
All is pretty unstable still.
Fixed in master with https://github.com/dereuromark/cakephp-translate/commit/bacb7a9dda2ff24ac0fdd0434b50b2d765047414#diff-ca4e08e36b5baa444389547883a68cc76854d9649523eb72997b5f52fecd1f97R172-R174
You can make a backport with similar 3 line change for your branch if needed. But I would encourage helping me to get the Cake 5.x version (master branch) to work again and move on from there.
Fresh cake4 (v4.2.3) installation. Happens when I open http://localhost:8765/admin/translate/
My steps: