Hallo,
ich habe ein problem mit meiner extension die ich gerade am erstellen bin.
Es kommt momentan immer folgende fehlermeldung wenn ich einen kommentar abgeben möchte.
The property "communityPosts" on the subject does not exist.
Das Steht in der Model/CommunityPostsComments
/**
* CommunityPostsComments
*/
class CommunityPostsComments extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* @var \IL\TextExtension\Domain\Model\CommunityCategory
*/
protected $communityCategory;
/**
* content
*
* @var string
*/
protected $content = '';
/**
* author
*
* @var string
*/
protected $author = '';
/**
* author
*
* @var \DateTime
*/
protected $date = '';
/**
* communityUser
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\IL\TextExtension\Domain\Model\CommunityUser>
*/
protected $communityUser = NULL;
/**
* __construct
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* @return void
*/
protected function initStorageObjects() {
$this->communityUser = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->communityCategory = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->date = new \DateTime();
}
/**
* Sets for date
*
* @param \DateTime $date
* @return void
*/
public function setDate(DateTime $date) {
$this->date = $date;
}
/**
* Returns for date
*
*
* @return \DateTime
*/
public function getDate() {
return $this->date;
}
/**
* Returns the content
*
* @return string $content
*/
public function getContent() {
return $this->content;
}
/**
* Sets the content
*
* @param string $content
* @return void
*/
public function setContent($content) {
$this->content = $content;
}
/**
* Returns the author
*
* @return string $author
*/
public function getAuthor() {
return $this->author;
}
/**
* Sets the author
*
* @param string $author
* @return void
*/
public function setAuthor($author) {
//$this->author = $author;
$this->author = $GLOBALS['TSFE']->fe_user->user['username'];
}
/**
* Adds a communityCategory
*
* @param \IL\TextExtension\Domain\Model\CommunityCategory $communityCategory
* @return void
*/
public function addCommunityCategory(\IL\TextExtension\Domain\Model\CommunityCategory $communityCategory) {
$this->communityCategory->attach($communityCategory);
}
/**
* Removes a communityCategory
*
* @param \IL\TextExtension\Domain\Model\CommunityCategory $communityCategoryToRemove The CommunityCategory to be removed
* @return void
*/
public function removeCommunityCategory(\IL\TextExtension\Domain\Model\CommunityCategory $communityCategoryToRemove) {
$this->communityCategory->detach($communityCategoryToRemove);
}
/**
* Returns the communityCategory
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public function getCommunityCategory() {
return $this->communityCategory;
}
/**
* Sets the communityCategory
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\IL\TextExtension\Domain\Model\CommunityCategory> $communityCategory
* @return void
*/
public function setCommunityCategory(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $communityCategory) {
$this->communityCategory = $communityCategory;
}
/**
* Adds a CommunityPostsComments
*
* @param \IL\TextExtension\Domain\Model\CommunityPostsComments $communityPostsComment
* @return void
*/
public function addCommunityPostsComment(\IL\TextExtension\Domain\Model\CommunityPostsComments $communityPostsComment) {
$this->communityPostsComments->attach($communityPostsComment);
}
/**
* Removes a CommunityPostsComments
*
* @param \IL\TextExtension\Domain\Model\CommunityPostsComments $communityPostsCommentToRemove The CommunityPostsComments to be removed
* @return void
*/
public function removeCommunityPostsComment(\IL\TextExtension\Domain\Model\CommunityPostsComments $communityPostsCommentToRemove) {
$this->communityPostsComments->detach($communityPostsCommentToRemove);
}
/**
* Returns the communityPostsComments
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\IL\TextExtension\Domain\Model\CommunityPostsComments> $communityPostsComments
*/
public function getCommunityPostsComments() {
return $this->communityPostsComments;
}
/**
* Sets the communityPostsComments
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\IL\TextExtension\Domain\Model\CommunityPostsComments> $communityPostsComments
* @return void
*/
public function setCommunityPostsComments(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $communityPostsComments) {
$this->communityPostsComments = $communityPostsComments;
}
Das Steht in dem Controller
/**
* CommunityPostsCommentsController
*/
class CommunityPostsCommentsController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* communityPostsCommentsRepository
*
* @var \IL\TextExtension\Domain\Repository\CommunityPostsCommentsRepository
* @inject
*/
protected $communityPostsCommentsRepository;
/**
* action create
*
* @param \IL\TextExtension\Domain\Model\CommunityPostsComments $newCommunityPostsComments
* @return void
*/
public function createAction(\IL\TextExtension\Domain\Model\CommunityPostsComments $newCommunityPostsComments) {
$this->addFlashMessage('Kommentar gepostet', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->communityPostsCommentsRepository->add($newCommunityPostsComments);
$this->redirect('show', 'CommunityPosts', NULL, array('communityPosts' => $communityPosts, 'communityCategory' => $this->request->getArgument('communityCategory')));
}
Und so sieht noch der template auschnitt aus
<f:form action="create" enctype="multipart/form-data" objectName="newCommunityPostsComments" object="newCommunityPostsComments" method="post" controller="CommunityPostsComments" arguments="{communityPosts : communityPosts, communityCategory : communityCategory}">
<div class="comments"><f:form.textarea property="content" rows="15" /></div>
<f:form.hidden property="author" value="{contentauthor}"/>
<f:form.submit class="button" value="Kommentar posten"><input class="button" type="submit" name="" value="Submit" /></f:form.submit>
</f:form>
Hoffe es kann mir jemand helfen.