Skip to content

Commit

Permalink
Add support for views global pseudo fields
Browse files Browse the repository at this point in the history
  • Loading branch information
indigoxela committed Nov 18, 2021
1 parent 8cf8206 commit 8afaa0d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion views_json.module
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,15 @@ function _views_json_render_fields($view, $row) {
}
else {
// Otherwise it's an internal value.
$field_raw = $row->{$view->field[$id]->field_alias};
$alias = $view->field[$id]->field_alias;
if (isset($row->{$alias})) {
$field_raw = $row->{$alias};
}
else {
// Pseudo fields like "Global: Custom text" have no raw value from
// database.
$field_raw = $field_output;
}
}
// Check if this is field is the entity's label.
if (empty($field->base_table)) {
Expand Down

0 comments on commit 8afaa0d

Please sign in to comment.