[TYPO3-mvc] Generating RSS Feed with ExtBase / Exception from Repository
Michael Knoll
mimi at kaktusteam.de
Fri Dec 25 04:22:28 CET 2009
Hi folks,
after working on it for some hours now, I simply can't find my bug while
trying to output an RSS Feed with ExtBase.
Here's what I did. I added the following lines of code to my TS setup.txt:
====
xml = PAGE
xml {
typeNum = 100
10 = USER
10 {
userFunc = tx_extbase_dispatcher->dispatch
pluginName = Pi1
extensionName = Yag
controller = Album
switchableControllerActions {
1 {
controller = Album
actions = rss
}
}
action = rss
settings =< plugin.tx_yag.settings
persistence =< plugin.tx_yag.persistence
view =< plugin.tx_yag.view
}
}
====
Inside my Album Controller, I implemented this function:
====
/**
* Rss Feed Action rendering a RSS Feed of media
*
* @return string The rendered RSS Feed
*/
public function rssAction() {
if ($this->request->hasArgument('album')) {
$albumRepository =
t3lib_div::makeInstance(
'Tx_Yag_Domain_Repository_AlbumRepository');
$albumUid = $this->request->getArgument('album');
$albums =
$this->albumRepository->findByUid(
intval($albumUid));
print_r($albums);
return "Hallo RSS World!";
} else {
return "Kein Album --> kein RSS!";
}
}
====
So what I get is an "Expected parameter 1 to be object, NULL given"
exception from my Repository. Seems like I have something misconfigured
in my TS-Controller call that is working when I'm calling the controller
as a page content.
When I call the URL with &type=100 I get the exception, if I call it
without this parameter, everything works fine.
So has anybody got an idea, what I'm missing in my configuration? The
output from the action is generated normally, if I do not want to load
any objects from the repository...
Greetings!
Michael
More information about the TYPO3-project-typo3v4mvc
mailing list