Skip to content
Snippets Groups Projects
Commit de9f13c1 authored by catch's avatar catch
Browse files

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views...

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views properties to core standards.
parent 928a366d
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -25,23 +25,23 @@ class MachineName extends FieldPluginBase {
/**
* @var array Stores the available options.
*/
var $value_options;
protected $valueOptions;
public function getValueOptions() {
if (isset($this->value_options)) {
if (isset($this->valueOptions)) {
return;
}
if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) {
$this->value_options = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
$this->valueOptions = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
}
else {
$this->value_options = call_user_func($this->definition['options callback']);
$this->valueOptions = call_user_func($this->definition['options callback']);
}
}
else {
$this->value_options = array();
$this->valueOptions = array();
}
}
......@@ -72,11 +72,11 @@ public function preRender(&$values) {
*/
public function render(ResultRow $values) {
$value = $values->{$this->field_alias};
if (!empty($this->options['machine_name']) || !isset($this->value_options[$value])) {
if (!empty($this->options['machine_name']) || !isset($this->valueOptions[$value])) {
$result = check_plain($value);
}
else {
$result = $this->value_options[$value];
$result = $this->valueOptions[$value];
}
return $result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment