? Success

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
27 Aug 2015

A state check when loading the categories should only be done when the publishing flag is set, otherwise it is not possible to get the unpublished or archived categories trough JCategories.

Testing instructions

  1. Open the categories manager for articles in the back end, Content -> Category Manager.
  2. Create two categories with status flag set to Unpublished.
  3. Add the following code to the file administrator/components/com_content/views/articles/view.html.php after the line 33 (public function display($tpl = null) {)

    $categories = JCategories::getInstance('Content', array(
        'access' => false,
        'published' => false
    ));
    $cats = $categories->get('root')->getChildren();
    echo 'Found '.count($cats).' categories!';die;
  4. On the back end go to Content -> Article Manager.

Expected result

On the web browser is shown Found 0 categories!. After applying the patch, you will see Found 2 categories!. This is correct, because we want to fetch all categories, ignoring the categories where we don't have access and which are archived or unpublished.


This is a follow up PR of #3870 because I've accidentally deleted the repository of the old PR. Apology for that :see_no_evil: .

avatar laoneo laoneo - open - 27 Aug 2015
avatar laoneo laoneo - change - 27 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 27 Aug 2015
Category Libraries
avatar kathastaden
kathastaden - comment - 16 Sep 2015

I just tested this patch with the given instructions, and I got the message "Found 5 categories!" without installing the patch. After I installed it, it still shows "Found 5 categories!".

So have I done something wrong? Do I have to create the two categories for the test in a special way?

avatar laoneo
laoneo - comment - 16 Sep 2015

Thanks for testing. Forget to mention, that you have to unpublish the categories. Updated the test instructions.

avatar kathastaden kathastaden - test_item - 16 Sep 2015 - Tested successfully
avatar kathastaden
kathastaden - comment - 16 Sep 2015

Okay. Thanks for the direct response!
Now the test was successful!

avatar FPerisa FPerisa - test_item - 17 Sep 2015 - Tested successfully
avatar FPerisa
FPerisa - comment - 17 Sep 2015

Test was successful with unpublished categories. :+1:

avatar zero-24 zero-24 - change - 17 Sep 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 17 Sep 2015

Thanks @laoneo, @kathastaden and @FPerisa lets move the magic number 7777 to RTC based on your testing and coding.


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

avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 17 Sep 2015
Milestone Added:
avatar rdeutz rdeutz - change - 1 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-01 18:16:45
Closed_By rdeutz
avatar rdeutz rdeutz - close - 1 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 1 Oct 2015
avatar rdeutz rdeutz - reference | cba331a - 1 Oct 15
avatar rdeutz rdeutz - merge - 1 Oct 2015
avatar rdeutz rdeutz - close - 1 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment