Change the type of the records manager to be the NodeViewCountRecordsManagerInterface instead of NodeViewCountRecordsManager

Created on 20 November 2023, about 1 year ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇲🇦Morocco filalianas7

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

Comments & Activities

  • Issue created by @filalianas7
  • 🇲🇦Morocco filalianas7

    After receiving a request to retrieve the most viewed nodes per language, I endeavored to enhance the module's functionality by incorporating language support. To achieve this, I aimed to override the records_manager service using a custom class within a custom module. Additionally, I intended to augment the nodeviewcount table by introducing a new langcode column.

    However, I encountered an obstacle as the NodeViewCountController constructor explicitly requires a first argument of type "\Drupal\nodeviewcount\NodeViewCountRecordsManager" and was thus unable to proceed with the modifications as planned.

    That's why I thought it would be helpful if we can change this by switching the argument type from the class NodeViewCountRecordsManager to NodeViewCountRecordsManagerInterface ?

    An initial patch has been uploaded for a starter point.

Production build 0.71.5 2024