Undefined array key location

Created on 17 June 2024, 6 months ago

Problem/Motivation

I just updated to the 2.0 version of this module and now I get this warning:
Warning: Undefined array key "location" in Drupal\views_json_source\Plugin\views\query\ViewsJsonQuery>Drupal\views_json_source\Plugin\views\query\{closure}() (line 669 of modules/contrib/views_json_source/src/Plugin/views/query/ViewsJsonQuery.php).

What can I do about this?

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands zebda

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @zebda
  • Assigned to PrabuEla
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia PrabuEla chennai
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia PrabuEla chennai
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Rajan Kumar@2026

    Rajan Kumar@2026 โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States karenann

    I am getting a similar error:

    Warning: Undefined array key "somekey" in Drupal\views_json_source\Plugin\views\exposed_form\JsonSelectOption->exposedFormAlter() (line 195 of modules/contrib/views_json_source/src/Plugin/views/exposed_form/JsonSelectOption.php).

    For me, I know that it is because my view's exposed form is calling a reference but the source JSON file does NOT have that reference.

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine AstonVictor

    the module doesn't have JsonSelectOption.php file.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia priti197

    @zebda, I don't see array key "location" at line 669 of modules/contrib/views_json_source/src/Plugin/views/query/ViewsJsonQuery.php
    Screenshot attached.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States karenann

    Re: #5 / #6

    Correct, there is no JsonSelectOption.php file. That is a custom thing we are trying out. I neglected to clarify that.

    The point of my message was to say that the error the OP was getting was likely because their JSON was missing the "location" key.

    I recommend that they examine their JSON source to make sure the payload includes the "location" data they are trying to utilize.

    Sorry for the confusion I created.

Production build 0.71.5 2024