Commit 2c22de56 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch '401-planet-typo3' of...

Merge branch '401-planet-typo3' of ssh://gitlab.typo3.org:2222/services/typo3.org/typo3.org into 401-planet-typo3
parents a861faa3 e773d436
Pipeline #10206 failed with stages
in 2 minutes and 3 seconds
......@@ -202,14 +202,16 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
$newT3planetArticles->setArticleDate($date);
if ($user) {
$newT3planetArticles->setName($user->getUsername());
$newT3planetArticles->setName($user->getName());
$newT3planetArticles->setEmail($user->getEmail());
$newT3planetArticles->setFeUserid($user->getUid());
}
$newT3planetArticles->setPid($storagePid);
$newT3planetArticles->setFeUserid($user->getUsername());
$newT3planetArticles->setPid($storagePid);
$this->articleRepository->add($newT3planetArticles);
$this->articleRepository->add($newT3planetArticles);
}
else {
$this->addFlashMessage('You need to login first!', 'No access!', FlashMessage::ERROR);
}
if ($backPid) {
$this->addFlashMessage('A new article inserted successfully!', 'Success!', FlashMessage::OK);
......
......@@ -80,9 +80,9 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
protected string $email = '';
/**
* @var int
* @var string
*/
protected int $feUserid = 0;
protected string $feUserid = '';
/**
* image
......@@ -262,9 +262,9 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Returns the feUserid
*
* @return int $feUserid
* @return string $feUserid
*/
public function getFeUserid(): int
public function getFeUserid(): string
{
return $this->feUserid;
}
......@@ -272,9 +272,9 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Sets the feUserid
*
* @param int $feUserid
* @param string $feUserid
*/
public function setFeUserid(int $feUserid)
public function setFeUserid(string $feUserid)
{
$this->feUserid = $feUserid;
}
......
......@@ -94,12 +94,12 @@ class ArticleRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
/**
* Function: getArticlesByUser
* This will return the category based on website domain.
* This will return the articles of a frontend user
*
* @param int $userID
* @param string $userID
* @return \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|\T3o\T3oPlanet\Domain\Model\Article[]
*/
public function getArticlesByUser(int $userID): \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
public function getArticlesByUser(string $userID): \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
{
$query = $this->createQuery();
$query->matching(
......
......@@ -20,10 +20,10 @@ return [
'iconfile' => 'EXT:t3o_planet/Resources/Public/Icons/tx_t3oplanet_domain_model_article.gif',
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, article_status, title, teasertext, article_date, link, is_featured, name, email, image, category_id, tag_id',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, article_status, title, teasertext, article_date, link, is_featured, name, email, fe_userid, image, category_id, tag_id',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, article_status, title, teasertext, link, article_date, is_featured, name, email, image, category_id, tag_id, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, article_status, title, teasertext, link, article_date, is_featured, name, email, fe_userid, image, category_id, tag_id, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'columns' => [
'sys_language_uid' => [
......@@ -197,6 +197,7 @@ return [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'readOnly' => true,
],
],
'image' => [
......
......@@ -10,7 +10,7 @@ CREATE TABLE tx_t3oplanet_domain_model_article (
article_date date NULL DEFAULT NULL,
name varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL,
fe_userid int(11) DEFAULT '0' NOT NULL,
fe_userid varchar(255) DEFAULT '' NOT NULL,
image int(11) unsigned NOT NULL default '0',
category_id int(11) unsigned DEFAULT '0' NOT NULL,
tag_id int(11) unsigned DEFAULT '0' NOT NULL
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment