Skip to content

Conversation

martinlagler
Copy link
Contributor

@martinlagler martinlagler commented Dec 20, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related issues/PRs sulu/SuluArticleBundle#655
License MIT

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.

@alexander-schranz
Copy link
Member

I'm not sure about naming it updated I would more go with lastModified. Personally I like the At prefix for datetimes: lastModifiedAt but as we are not yet using that prefix for existsingcreated, changed, published, authored, ... it would be strange to include it now in one and not for the others.

@alexander-schranz
Copy link
Member

As discussed we will name it lastModified

@alexander-schranz alexander-schranz added the Feature New functionality not yet included in Sulu label Jan 9, 2024
Comment on lines 252 to 255
/**
* @var bool
*/
protected $lastModifiedEnabled;
Copy link
Member

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;
    }

Copy link
Member

@alexander-schranz alexander-schranz left a 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

@alexander-schranz alexander-schranz changed the title Add updated date to page settings Add lastModified field to page settings Jan 10, 2024
@martinlagler martinlagler force-pushed the feature/updated-date branch 8 times, most recently from 4bea5df to 3db5606 Compare January 11, 2024 10:13
Copy link
Member

@alexander-schranz alexander-schranz left a 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.

Comment on lines 19 to 41
/**
* 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);

Copy link
Member

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.

@martinlagler martinlagler force-pushed the feature/updated-date branch 2 times, most recently from 459c483 to c7dcea4 Compare January 17, 2024 13:59
@martinlagler martinlagler changed the base branch from 2.5 to 2.6 January 23, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants