? Success

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
6 Oct 2020

Summary of Changes

Class was removed without deprecation but it still has an alias valid until 5.0. This is causing stub generator to fail.
This restores the class, proxies its code to new Versioning API, and deprecates it for 5.0.

Testing Instructions

Would be good to test that its methods are still working as expected. Besides that try running stub generator script.

Actual result BEFORE applying this Pull Request

Stub generator fails with error:

ReflectionException {#160
  #message: "Class Joomla\CMS\Helper\ContentHistoryHelper does not exist"
  #code: -1
  #file: "build\stubGenerator.php"
  #line: 75
  trace: {
    build\stubGenerator.php:75 {
      StubGenerator->doExecute()^
      › // Figure out if the alias is for a class or interface
      › $reflection = new ReflectionClass($newName);
      › $type       = $reflection->isInterface() ? 'interface' : 'class';
      arguments: {
        $argument: "Joomla\CMS\Helper\ContentHistoryHelper"
      }
    }
    libraries\src\Application\CliApplication.php:241 { …}
    build\stubGenerator.php:147 { …}
  }
}

Expected result AFTER applying this Pull Request

Stub generator works and it's possible to get/delete/store versions using the class.

Documentation Changes Required

No.

avatar SharkyKZ SharkyKZ - open - 6 Oct 2020
avatar SharkyKZ SharkyKZ - change - 6 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Oct 2020
Category Libraries
2586293 6 Oct 2020 avatar SharkyKZ CS
avatar SharkyKZ SharkyKZ - change - 6 Oct 2020
Labels Added: ?
avatar SharkyKZ SharkyKZ - change - 6 Oct 2020
The description was changed
avatar SharkyKZ SharkyKZ - edited - 6 Oct 2020
avatar ceford
ceford - comment - 7 Oct 2020

I could not figure out how to test this. I searched the code for both ContentHistoryHelper and JHelperContenthistory and could not find anything testable. I guess it may be something in Versions - but where?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30932.

avatar SharkyKZ
SharkyKZ - comment - 8 Oct 2020

This isn't used by core and can only be properly tested by using custom code.

avatar piotr-cz
piotr-cz - comment - 15 Jun 2021

I'm not sure if it's right thing to restore the class, but the fact is that subs generator is broken and restoring this class makes it work again as it's present in classmap file:

JLoader::registerAlias('JHelperContenthistory', '\\Joomla\\CMS\\Helper\\ContentHistoryHelper', '5.0');

If this class is restored, part of this PR should be removing it from list of files marked to delete during migration from 3.10 to 4.0:

'/libraries/src/Helper/ContentHistoryHelper.php',

avatar wilsonge
wilsonge - comment - 25 Jul 2021

Closing in favour of #34904 adding the deprecations back into 3.10

avatar wilsonge wilsonge - close - 25 Jul 2021
avatar wilsonge wilsonge - change - 25 Jul 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-07-25 22:41:30
Closed_By wilsonge
avatar piotr-cz
piotr-cz - comment - 26 Jul 2021

@wilsonge does the #34904 fix the issue (broken stubs generation)?

avatar wilsonge
wilsonge - comment - 27 Jul 2021

That one I directly fixed with f5442b3

avatar piotr-cz
piotr-cz - comment - 28 Jul 2021

@wilsonge Thank you, this looks like a proper solution for this problem

Add a Comment

Login with GitHub to post a comment