After correcting a known BUG for the admin menu, there麓s two pages witch shows this error:
Call to a member function getTranslatedAttribute() on null
An admin page should render
```
/var/www/html/primorossi/primorossi/vendor/tcg/voyager/src/Http/Controllers/VoyagerBaseController.php
{
// GET THE SLUG, ex. 'posts', 'pages', etc.
$slug = $this->getSlug($request);
// GET THE DataType based on the slug
$dataType = Voyager::model('DataType')->where('slug', '=', $slug)->first();
// Check permission
$this->authorize('browse', app($dataType->model_name));
$getter = $dataType->server_side ? 'paginate' : 'get';
$search = (object) ['value' => $request->get('s'), 'key' => $request->get('key'), 'filter' => $request->get('filter')];
$searchNames = [];
if ($dataType->server_side) {
$searchable = array_keys(SchemaManager::describeTable(app($dataType->model_name)->getTable())->toArray());
$dataRow = Voyager::model('DataRow')->whereDataTypeId($dataType->id)->get();
foreach ($searchable as $key => $value) {
$displayName = $dataRow->where('field', $value)->first()->getTranslatedAttribute('display_name');
$searchNames[$value] = $displayName ?: ucwords(str_replace('_', ' ', $value));
}
}
```
Can麓t figure it out...
Hi, I had the same problem, to correct I went to the bread and rewrote one of the translations I had done earlier, so it seems to me that the problem is that when translating the fields in the bread there can be a mismatch between the amount of translations and quantity of fields in the table.
I had the same problem too.
Happened when I delete some fields from a table (with bread).
I had to manually remove some entries from data_rows and data_type tables to fix the problem.
Ok, but this does not solve the problem. My database has a lot of tables after all. Imagin searching wich was the last one I麓ve changed or translated.
Still can麓t figure it out...
I encounter this issue in case-sensitive databases. For example, if I have a column platformContentId:
On line 50:
$searchable = array_keys(SchemaManager::describeTable(app($dataType->model_name)->getTable())->toArray());
SchemaManager::describeTable() returns a Collection. Each of its items use array keys which are the lowered column name.

As $searchable is just the array_keys, which do not actually match the column's 'name', line 53 fails as it attempts to run first() on a query which is searching for 'platformcontentid' instead of 'platformContentId'.
This can be easily solved by changing toArray() to pluck('name') in line 50. Existing:
$searchable = array_keys(SchemaManager::describeTable(app($dataType->model_name)->getTable())->toArray());
Proposed:
$searchable = SchemaManager::describeTable(app($dataType->model_name)->getTable())->pluck('name');
Your problem may have a different cause but I hope this helps.
@marcellopato go to Tools->BREAD edit and save the BREAD that had fields removed in db, that will remove all data_rows that are not used anymore for that BREAD.
@PrimoRossi
After correcting a known BUG for the admin menu, there麓s two pages witch shows this error:
Which pages?
I think that, other than what @voxlunch said for columns that are not lower case, this problem happens when you add a field in a table and then don't update BREAD configuration.
In that case the needed data_row is not created and $dataRow->where('field', $value)->first() returns null.
Manual solution
After adding, deleting or renaming a field in a table managed with BREAD go save again BREAD settings.
This happens to me when i select the server side pagination in my BREAD configuration (which i need because i have a lot of records), if i disable server side pagination, all works fine. I tried saving and deleting / recreating BREAD but nothing change, the error still persist. Any solutions?
Edit: I don't have multilingual enabled on my project.
Laravel: 5.8.*
Voyager: 1.2
PHP: 7.2.10
@oriolcabau that's because the error happens when it tries to get translated labels for search that is only available when server side mode is enabled.
If you don't have a field with uppercase letters you should be able to solve reading my previous comments.
It happens when server-side pagination in on. That麓s a fact.
Turn it off and the bug disappears.
This bug happens at vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php line 811.
The line referenced above breaks Voyager bread when column name contains uppercase characters
@damms005 that only lower case keys not column names.
The problem with uppercase columns is explained and fixed by @voxlunch
Fixed in https://github.com/the-control-group/voyager/pull/4442 (to be released in 1.3)
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
@marcellopato go to Tools->BREAD edit and save the BREAD that had fields removed in db, that will remove all data_rows that are not used anymore for that BREAD.