Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Check for element type when setting postDate
Browse files Browse the repository at this point in the history
  • Loading branch information
steverowling committed Jun 7, 2016
1 parent 69fefb9 commit f1c23c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fieldtypes/IncrementFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private function _getMaxNumber()
*/
private function setPostDate()
{
if (is_null($this->element->postDate)) {
if (($this->element == ElementType::Entry) && is_null($this->element->postDate)) {
$this->element->postDate = new DateTime();
}
}
Expand Down

0 comments on commit f1c23c6

Please sign in to comment.