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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot from 2024-01-05 15-23-40.png | 102.52 KB | dineshkumarbollu |
Issue fork live_weather-3410009
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
Comment #4
abhishek_gupta1 commented@riteshgupta, i have fixed the issue, Please kindly review the MR
Comment #5
dineshkumarbollu commentedThe MR!7 fixes the issue now page is working as expected, Attaching screenshot for reference.Thanks
Comment #6
riteshgupta commented