The website encountered an unexpected error. Please try again later.
Error: Using $this when not in object context in json_field_field_views_data() (line 19 of modules/contrib/json_field/json_field.views.inc).

Comments

hubertinio created an issue. See original summary.

hubertinio’s picture

I see that bug was fixed here
git clone --branch 8.x-1.x https://git.drupal.org/project/json_field.git

But still occurs when install module via composer

"require": {
        "drupal/json_field": "1.x",
}
jimthunderbird’s picture

This issue can be fixed by applying changes to the code in function json_field_field_views_data at json_field.views.inc

function json_field_field_views_data(FieldStorageConfigInterface $field_storage) {
  // Use the JSONViews service to get the views data.
  return \Drupal::service('json_field.views')->getViewsFieldData($field_storage);
}
emudojo’s picture

this works, odd that up to this day is still broken when pulling from the stable branch from composer

alexverb’s picture

Status: Active » Needs review
StatusFileSize
new523 bytes

Must have been a bad merge or something. Here's a patch with the correction.

alexverb’s picture

Version: 8.x-1.x-dev » 8.x-1.0-rc1

Changing version.

Status: Needs review » Needs work

The last submitted patch, 5: json_field-object_context_issue-2985340-5.patch, failed testing. View results

lamp5’s picture

I can confirm that this patch fixes this issue.

joshmiller’s picture

Confirmed that composer is still pulling the broken version of the module (exactly opposite of what a package manager is supposed to do)

it-cru’s picture

I think this change is already committed to 8.x-1.x-dev branch and we only need a new tagged RC2 to fix this issue.

https://cgit.drupalcode.org/json_field/commit/?id=cd0785f

it-cru’s picture

Status: Needs work » Reviewed & tested by the community
dawehner’s picture

Status: Reviewed & tested by the community » Fixed

I just pushed a RC2, so this should be resolved :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.