-
Notifications
You must be signed in to change notification settings - Fork 350
Add lastModified field to page settings #7238
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
Conversation
d3f9fc6
to
9b5fc5b
Compare
I'm not sure about naming it |
As discussed we will name it |
9b5fc5b
to
30e0ef9
Compare
/** | ||
* @var bool | ||
*/ | ||
protected $lastModifiedEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this here?
Is it not enough if we do:
public function getLastModifiedEnabled()
{
return $this->lastModified !== null;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where not required we should not return the lastModifiedEnabled
that is just a flag for the Admin UI which we handle via virtual property in the serializer. In the other cases we should not write any props called like that to documents or somewhere else. Only return where we need it to return it for the pages / articles APIs
src/Sulu/Bundle/PageBundle/Resources/config/serializer/Document.BasePageDocument.xml
Outdated
Show resolved
Hide resolved
src/Sulu/Component/Content/Document/Behavior/LocalizedAuthorBehavior.php
Outdated
Show resolved
Hide resolved
src/Sulu/Component/Content/Document/Subscriber/LastModifiedSubscriber.php
Outdated
Show resolved
Hide resolved
src/Sulu/Component/Content/Document/Subscriber/LastModifiedSubscriber.php
Outdated
Show resolved
Hide resolved
src/Sulu/Component/Content/Metadata/Loader/StructureXmlLoader.php
Outdated
Show resolved
Hide resolved
4bea5df
to
3db5606
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need rebase to 2.6, we should wait with the merge until Article and Content Bundle is also implemented and fine.
/** | ||
* Returns lastModifiedEnabled. | ||
* | ||
* @return bool | ||
*/ | ||
public function getLastModifiedEnabled(); | ||
|
||
/** | ||
* Returns lastModified-date. | ||
* | ||
* @return \DateTime|null | ||
*/ | ||
public function getLastModified(); | ||
|
||
/** | ||
* Set lastModified-date. | ||
* | ||
* @param \DateTime|null $lastModified | ||
* | ||
* @return void | ||
*/ | ||
public function setLastModified($lastModified); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bc break, We need to create a new interface for this LocalizedLastModifiedBehavior
.
459c483
to
c7dcea4
Compare
c7dcea4
to
6d7d36d
Compare
What's in this PR?
Add new updated date field to the settings tab, with a toggler to enable and disable it.
Why?
So pages can have a editable update date.