Warning: Undefined array key "#content_type"

Created on 2 June 2023, over 1 year ago
Updated 13 June 2023, over 1 year ago

Problem/Motivation

Got this undefined array key warning when accessing the view page.

Warning: Undefined array key "#content_type" in Drupal\json_feed\Plugin\views\display\JsonFeed::buildResponse() (line 76 of /var/www/html/web/modules/contrib/json_feed/src/Plugin/views/display/JsonFeed.php)

Steps to reproduce

Install module;
Create a view;
Set JSON Feed format and show JSON fields;
Add Id, Title and Link to content fields and populate id attribute, url attribute and content_text attribute JSON field settings.
Add Content type and published filter criteria.

Proposed resolution

Hardcode $build['#content_type'] on Drupal\json_feed\Plugin\views\display\JsonFeed::buildResponse() ?

Current D9 version: 9.5.9.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal joao.ramos.costa

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

Comments & Activities

Production build 0.71.5 2024