Skip to content

Commit

Permalink
fix missing second argument to isValueEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
riekusdn committed Sep 23, 2019
1 parent ad1f144 commit 4f16d66
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function serializeValue($value, ElementInterface $element = null)
}

// Get the raw value
$value = (string)$value;
$value = (string) $value;

if (!$value) {
return null;
Expand All @@ -130,7 +130,7 @@ public function serializeValue($value, ElementInterface $element = null)
public function isValueEmpty($value, ElementInterface $element): bool
{
/** @var \Twig_Markup|null $value */
return $value === null || parent::isValueEmpty((string)$value);
return $value === null || parent::isValueEmpty((string) $value, $element);
}

/**
Expand All @@ -141,7 +141,7 @@ public function getInputHtml($value, ElementInterface $element = null): string
$view = Craft::$app->getView();
$id = $view->formatInputId($this->handle);
$nsId = $view->namespaceInputId($id);
$encValue = htmlentities((string)$value, ENT_NOQUOTES, 'UTF-8');
$encValue = htmlentities((string) $value, ENT_NOQUOTES, 'UTF-8');
$ckeditorConfig = Json::encode($this->_getCkeditorConfig());

$js = <<<JS
Expand Down Expand Up @@ -177,7 +177,7 @@ public function getInputHtml($value, ElementInterface $element = null): string
public function getStaticHtml($value, ElementInterface $element): string
{
/** @var \Twig_Markup|null $value */
return '<div class="text">'.($value ?: '&nbsp;').'</div>';
return '<div class="text">' . ($value ?: '&nbsp;') . '</div>';
}

// Private Methods
Expand All @@ -192,7 +192,7 @@ public function getStaticHtml($value, ElementInterface $element): string
private function _getCustomConfigOptions(string $dir): array
{
$options = ['' => Craft::t('app', 'Default')];
$path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir;
$path = Craft::$app->getPath()->getConfigPath() . DIRECTORY_SEPARATOR . $dir;

if (is_dir($path)) {
$files = FileHelper::findFiles($path, [
Expand Down Expand Up @@ -249,7 +249,7 @@ private function _getConfig(string $dir, string $file = null)
return false;
}

$path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$file;
$path = Craft::$app->getPath()->getConfigPath() . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $file;

if (!is_file($path)) {
return false;
Expand Down

0 comments on commit 4f16d66

Please sign in to comment.