Problem

When update Drupal LMS module to 1.1.8 and LMS Xapi modul to 1.0.0-beta1 the following error message appears:

Fatal error: Access level to Drupal\lms_xapi_lesson\Entity\Handlers\XapiLmsLessonHandler::$getRequestTime must be protected (as in class Drupal\lms\Entity\Handlers\LmsLessonHandlerBase) or weaker in /Users/lajcsika/xhtdocs/emberimeltosag/modules/lms/lms_xapi/modules/lms_xapi_lesson/src/Entity/Handlers/XapiLmsLessonHandler.php on line 21

Proposed resolution

In lms_xapi/modules/lms_xapi_lesson/src/Entity/Handlers/XapiLmsLessonHandler.php file __construct function:

the "privateprotected \Closure $getRequestTime," like this:

  public function __construct(
    #[AutowireCallable(service: 'entity.form_builder', method: 'getForm')]
    \Closure $getEntityForm,
    #[AutowireCallable(service: 'datetime.time', method: 'getRequestTime')]
    protected \Closure $getRequestTime,
    EntityTypeManagerInterface $entityTypeManager,
    TrainingManager $trainingManager,
    AccountInterface $currentUser,
    protected readonly FormBuilderInterface $formBuilder,
  ) {
    parent::__construct($getEntityForm, $getRequestTime, $entityTypeManager, $trainingManager, $currentUser);
  }

Issue fork lms_xapi-3600981

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

lv46gl created an issue. See original summary.

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

gorkagr’s picture

Priority: Normal » Critical
Status: Active » Needs review

Raised to critical as the error blocks installation of the module.
I have removed directly the 'private' (and not added 'protected'), as the original class already declares it as protected, so there is no need to add it again.
Adding a MR with the change