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

Commit

Permalink
Merge pull request #6 from steverowling/master
Browse files Browse the repository at this point in the history
Cast padding to int to prevent PHP warning
  • Loading branch information
Bob Olde Hampsink authored Jul 21, 2016
2 parents a1b8448 + f1c23c6 commit 76057f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fieldtypes/IncrementFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function prepValue($value)
}

// Pad zeroes
$value = str_pad($value, $settings->padding, '0', STR_PAD_LEFT);
$value = str_pad($value, (int) $settings->padding, '0', STR_PAD_LEFT);

// Add prefix
$value = craft()->templates->renderObjectTemplate($settings->prefix, $this->element).$value;
Expand Down 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 76057f5

Please sign in to comment.