PollListItem freed from noticeListItemAdapter clutches

In the future, use events for formatting microapp notices, more specifically
through the plugin's function "showNoticeContent" or similar, which is called
from MicroAppPlugin, which is extended from ActivityHandlerPlugin.
This commit is contained in:
Mikael Nordfeldth
2014-10-26 14:48:02 +01:00
parent fe92d7cf95
commit f69f713360
4 changed files with 37 additions and 122 deletions

View File

@@ -97,11 +97,10 @@ abstract class MicroAppPlugin extends ActivityHandlerPlugin
return true;
}
$adapter = $this->adaptNoticeListItem($nli);
if (empty($adapter)) {
throw new ServerException('Could not adapt NoticeListItem');
}
// Legacy use was creating a "NoticeListItemAdapter", but
// nowadays we solve that using event handling for microapps.
// This section will remain until all plugins are fixed.
$adapter = $this->adaptNoticeListItem($nli) ?: $nli;
$adapter->showNotice();
$adapter->showNoticeAttachments();