Task #13715

Calling Repository->remove($object) breaks application.

Added by Conor Hackett over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-03-09
Due date:
% Done:

0%


Description

Hi All,

I'm pretty new here so apologies if the solution to my problem is obvious.

Anyway, I'm working through the getting-started tutorial (blog) and decided I wanted a link to delete a blog post.

I've setup a function in in the PostController.php file as follows:

/**
  * Deletes an existing post.
  * 
  * @param \F3\Blog\Domain\Model\Post $post A post object to be deleted.
  * 
  * @return void
*/
public function deleteAction(\F3\Blog\Domain\Model\Post $post) {
$this->postRepository->remove($post); //This line breaks the application.
$this->flashMessageContainer->add('Your post has been deleted');
$this->redirect('index');
}

After I call this method I get the following error:
#1: Catchable Fatal Error: Argument 1 passed to F3\FLOW3\Persistence\DataMapper::mapSingleObject() must be an array, boolean given, called in O:\fr_test\flow3_blog_tut\Packages\Framework\FLOW3\Classes\Persistence\DataMapper.php on line 258 and defined in O:\fr_test\flow3_blog_tut\Packages\Framework\FLOW3\Classes\Persistence\DataMapper.php line 121

History

#1 Updated by Conor Hackett over 9 years ago

Sorry, I hit update instead of preview.

After this error is created it is carried through on all pages. Nothing will work afterwards so I need to extract my backup and start from there.

I'm not sure what is causing this. I'm sure somebody else has come across this before.

Any guidance is greatly appreciated.

Thanks in advance.

--Conor

Also available in: Atom PDF