Skip to content

Commit

Permalink
[FIX] 0043144: Failed test: Link Resolver Image Display
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Jan 28, 2025
1 parent 9d7db1e commit cdef354
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ protected function buildFilter(): ?StandardFilter
);
}

private function renderLibraryButtons(int $entry_id): array
{
$entry = $this->facade->entryFactory()->findByIdAndTypeString($entry_id, $this->facade->type()->getStringRepresentation());

$settings = $this->facade->libraryFactory()->getAll();
if (count($settings) === 0) {
return [];
}

$buttons = [];

foreach ($settings as $set) {
$presentation = new ilBiblLibraryPresentationGUI($set, $this->facade, $this->ctrl, $this->lng, $this->ui);
$buttons[$set->getName()] = $presentation->getButton($this->facade, $entry);
}

return $buttons;
}

protected function buildTable(): PresentationTable
{
$records = $this->getData();
Expand Down Expand Up @@ -154,14 +173,16 @@ function (
$author = $record['autor'] = $record['author'] ?? $record['AU'] ?? '';
$title = $record['title'] = $record['title'] ?? $record['TI'] ?? '';
$year = $record['year'] = $record['year'] ?? $record['PY'] ?? '';
$entry_id = $record['entry_id'];

unset($record['author'], $record['title'], $record['AU'], $record['TI']);
unset($record['author'], $record['title'], $record['AU'], $record['TI'], $record['entry_id']);
$translated_record = $this->getRecordWithTranslatedKeys($record);

return $row
->withHeadline($title)
->withSubheadline($author)
->withImportantFields([$year])
->withFurtherFields($this->renderLibraryButtons($entry_id))
->withContent($ui_factory->listing()->descriptive($translated_record));
}
)->withData($records_current_page);
Expand Down Expand Up @@ -211,6 +232,7 @@ protected function getData(): array
$entry_attributes = $this->facade->attributeFactory()->getAttributesForEntry($bibl_entry);
$sorted_attributes = $this->facade->attributeFactory()->sortAttributes($entry_attributes);
$entry_data = [];
$entry_data['entry_id'] = $entry['entry_id'];
foreach ($sorted_attributes as $sorted_attribute) {
$entry_data[$sorted_attribute->getName()] = $sorted_attribute->getValue();
}
Expand Down

0 comments on commit cdef354

Please sign in to comment.