? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
8 Jun 2021

Pull Request for Issue # .

Summary of Changes

This PR makes some cleanup to Blog Sample Data plugin:

  1. Correct return data type of some methods in docblock
  2. Unify return data type of some method to array. In some methods, we return both array and stdClass, it works because at the end, the return data will be json encoded, but we should choose to use one type only.
  3. Replace deprecated method class:
  • Factory::getLanguage() with $this->app->getLanguage()
  • Factory::getUser() with $this->app->getIdentity()
  • Replace $app = Factory::getApplication(); with injected $this->app

Testing Instructions

  1. Code review
  2. Or install latest Joomla 4.0-dev, then install Blog Sample Data and make sure sample data is still being installed properly.
avatar joomdonation joomdonation - open - 8 Jun 2021
avatar joomdonation joomdonation - change - 8 Jun 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2021
Category Front End Plugins
a51b778 8 Jun 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 8 Jun 2021
Labels Added: ?
avatar sandramay0905 sandramay0905 - test_item - 8 Jun 2021 - Tested successfully
avatar sandramay0905
sandramay0905 - comment - 8 Jun 2021

I have tested this item successfully on a51b778

Test using welsh language.


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

avatar PhilETaylor
PhilETaylor - comment - 8 Jun 2021

I have not tested :) but I will say be careful replacing Factory::getLanguage() with $this->app->getLanguage() at the moment, in 100% of the attempts I have made to replace these they then dont work. It seems it is not ready to be used through the app just yet and you dont always get the results intended.

avatar joomdonation
joomdonation - comment - 8 Jun 2021

@PhilETaylor Real test worked well for me. Also, I tried to write some code to test the behavior for some methods called on this plugin:

$this->app->getLanguage()->load

$this->app->getLanguage()->getTag()

And it worked OK. So I guess it's fine for the change in this plugin

avatar PhilETaylor
PhilETaylor - comment - 8 Jun 2021

If it works here then great, just keep in mind what I said for next time :)

avatar joomdonation
joomdonation - comment - 8 Jun 2021

If it works here then great, just keep in mind what I said for next time :)

I can only confirm it works for the changes in this PR :). For other contexts , I could not confirm :D.

avatar PhilETaylor
PhilETaylor - comment - 8 Jun 2021

/me bookmarks this thread for "next time" mwah mwah mwah

avatar jwaisner jwaisner - test_item - 9 Jun 2021 - Tested successfully
avatar jwaisner
jwaisner - comment - 9 Jun 2021

I have tested this item successfully on a51b778

Applied PR and Blog sample data populated properly.


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

avatar jwaisner jwaisner - change - 9 Jun 2021
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 9 Jun 2021

RTC


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

avatar chmst chmst - change - 9 Jun 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-06-09 06:43:47
Closed_By chmst
Labels Added: ?
avatar chmst chmst - close - 9 Jun 2021
avatar chmst chmst - merge - 9 Jun 2021
avatar chmst
chmst - comment - 9 Jun 2021

Thanks!

Add a Comment

Login with GitHub to post a comment