[FLOW3-general] Exception while property mapping at property path "":Object with identity "" not found.

Matthias Habegger theis_mh at gmx.ch
Wed Nov 30 16:26:14 CET 2011


Thanks to afoeder in the IRC channel its solved:

The simplified solution is:
--
	/**
	 * Shows a list of all books with a nice filter
	 *
	 * @param string $text The contained text
	 * @param string $language The language to filter
	 * @return void
	 */
	public function searchAction($text='', $language='', $category='', 
$owner='') {
		$this->view->assign('text', $text);

		$languages = array_merge(Array('' => ''), 
$this->languageRepository->findAll()->toArray());
		$this->view->assign('languages', $languages);
		$this->view->assign('language', $language);
$this->bookRepository->findWithFilter($this->userRepository->findActive(), 
$text, $this->languageRepository->findByIdentifier($language)));
	}
--

Regards,
Matthias



Am 30.11.2011 13:03, schrieb Matthias Habegger:
> Hi there,
>
> I want to filter my list by a few criteria, so I programmed a nice
> filter form.
> Everything works fine, until I select the empty filter, then I get the
> following Error:
> --
> Uncaught Exception in FLOW3
> #1297759968: Exception while property mapping at property path "":Object
> with identity "" not found. (More information)
> ...
>
> Nested Exception
> #1297933823: Object with identity "" not found. (More information)
> ...
> --
>
>
> Template:
> --
> <f:form action="search">
> <f:form.textfield name="text" value="{text}" />
> <f:form.select name="language" value="{language}" options="{languages}"
> optionLabelField="name"
> <f:form.submit value="Search"/>
> </f:form>
>
> <f:for each="{books}" as="book">
> {book.title}
> </f:for>
> --
>
> Action method in controller:
> --
> /**
> * Shows a list of all books with a nice filter
> *
> * @param string $text The contained text
> * @param \Habex\Library\Domain\Model\Language $language The language to
> filter
> * @return void
> */
> public function searchAction($text='',
> \Habex\Library\Domain\Model\Language $language = NULL) {
> $this->view->assign('text', $text);
>
> $languages = array_merge(Array('' => ''),
> $this->languageRepository->findAll()->toArray());
> $this->view->assign('languages', $languages);
> $this->view->assign('language', $language);
>
> $this->view->assign('books',
> $this->bookRepository->findWithFilter($this->userRepository->findActive(),
> $text, $language);
> }
> --
>
> Thanks.
>
> -Matthias



More information about the FLOW3-general mailing list