User tests: Successful: Unsuccessful:
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.
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;
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 .
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Thanks for testing. Forget to mention, that you have to unpublish the categories. Updated the test instructions.
Okay. Thanks for the direct response!
Now the test was successful!
Test was successful with unpublished categories.
Status | Pending | ⇒ | Ready to Commit |
Thanks @laoneo, @kathastaden and @FPerisa lets move the magic number 7777
to RTC based on your testing and coding.
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-01 18:16:45 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
Milestone |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
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?