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 follows

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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

riteshgupta created an issue. See original summary.

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review

@riteshgupta, i have fixed the issue, Please kindly review the MR

dineshkumarbollu’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new102.52 KB

The MR!7 fixes the issue now page is working as expected, Attaching screenshot for reference.Thanks

riteshgupta’s picture

Issue summary: View changes