ArgumentCountError: Too few arguments to function Drupal\live_weather\LiveWeather::__construct(), 2 passed

Created on 20 December 2023, about 1 year ago
Updated 5 January 2024, 12 months ago

Problem/Motivation

ArgumentCountError: Too few arguments to function Drupal\live_weather\LiveWeather::__construct(), 2 passed when go to the following url "/admin/config/services/live_weather/location".

ArgumentCountError: Too few arguments to function Drupal\live_weather\LiveWeather::__construct(), 2 passed in /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 3 expected in Drupal\live_weather\LiveWeather->__construct() (line 52 of /var/www/html/modules/live_weather/src/LiveWeather.php)

Steps to reproduce

First Upgrade Module from 8.x-2.5 to 3.0.0 then open the following url "/admin/config/services/live_weather/location" there is an error "The website encountered an unexpected error. Please try again later."

Proposed resolution

Update the live_weather.services.yml and updated code is as follwos

services:
  live_weather.controller:
    class: Drupal\live_weather\LiveWeather
    arguments: ['@http_client', '@logger.channel.live_weather', '@config.factory']
  logger.channel.live_weather:
    parent: logger.channel_base
    arguments: ['live_weather']

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024