Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added authored date and settings tab #13

Merged
merged 2 commits into from
Aug 17, 2016

Conversation

wachterjohannes
Copy link
Member

@wachterjohannes wachterjohannes commented Aug 16, 2016

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets none
Related issues/PRs none
License MIT
Documentation PR none

What's in this PR?

This PR adds an authored date to article.

To Do

  • Tests

@wachterjohannes wachterjohannes force-pushed the feature/authored-date branch 3 times, most recently from 771706a to 5aeaeda Compare August 16, 2016 10:19
*
* @return $this
*/
public function setAuthored($authored)
Copy link
Member

@alexander-schranz alexander-schranz Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not able to be null add the following line to __construct:

$this->authored = new \DateTime();

@alexander-schranz
Copy link
Member

alexander-schranz commented Aug 16, 2016

it would also make sense to add an authors field which is an array of contact ids.

@alexander-schranz
Copy link
Member

tests worked for me locally so it seems more a travis-ci setup problem.

@@ -283,6 +288,15 @@ private function persistDocument($data, $document, $locale)
);
}

private function getAuthors(array $authors)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpdocs missing

*
* @var int[]
*/
protected $authors;
Copy link
Member

@alexander-schranz alexander-schranz Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we initiliazed this as array that it always return an array?
@wachterjohannes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

private function getAuthors(array $authors)
{
if (0 === count($authors)) {
return [$this->getUser()->getContact()->getId()];
Copy link
Member

@alexander-schranz alexander-schranz Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would only do this when the document is created not on edit when the author is removed.

@alexander-schranz
Copy link
Member

missing translations: sulu_article.authored, sulu_article.authors, ...

@alexander-schranz
Copy link
Member

event missing when only change authors. I think you need to throw tab dirty on sulu.content_changed

@alexander-schranz alexander-schranz merged commit 958f12c into develop Aug 17, 2016
@alexander-schranz alexander-schranz deleted the feature/authored-date branch August 17, 2016 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants