Hello,
My issue is quite peculiar, after upgrading to Espo 9.2.0 my AppParam is undefined.
As far as I've seen there have been no compatibility changes that would warrant this behavior.
This is my frontend view:
and this is my AppParams class:
of course I also have the correct metadata in app->appParams.json
Any suggestions on what could be wrong?
My issue is quite peculiar, after upgrading to Espo 9.2.0 my AppParam is undefined.
As far as I've seen there have been no compatibility changes that would warrant this behavior.
This is my frontend view:
PHP Code:
define('leaflet:views/settings/fields/forward-geocoder-provider', ['views/fields/enum'], (Dep) => {
return class extends Dep {
setup() {
super.setup();
this.setupOptions();
}
setupOptions() {
const leafletConfig = this.getHelper().getAppParam('Leaflet');
this.params.options = leafletConfig ? Object.keys(leafletConfig) : [''];
if (this.params.options.length === 0) {
this.params.options = [''];
}
}
};
});
PHP Code:
<?php
namespace Espo\Modules\Leaflet\Classes\AppParams;
use Espo\ORM\EntityManager;
use Espo\Tools\App\AppParam;
class Leaflet implements AppParam
{
private EntityManager $entityManager;
public function __construct(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
public function get(): array
{
$repository = $this->entityManager->getRDBRepository('Integration');
$list = $repository
->select(['id'])
->where([
'enabled' => true,
'data*' => '%Leaflet%'
])
->find();
$result = [
'Nominatim' => [
'id' => 'nominatim',
'name' => 'Nominatim',
],
];
foreach ($list as $item) {
$result[$item->id] = [
'id' => $item->id,
'name' => $item->id,
];
}
return $result;
}
}
PHP Code:
{
"Leaflet": {
"className": "Espo\\Modules\\Leaflet\\Classes\\AppParams\\Leaflet"
}
}

Comment