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.
How should the testing instructions be as it is development only. In form of a unit test?
MAybe add some example code and tell where to insert it and what to echo or so.
Or write a small plugin which does the job. That would probably the easiest way to test something.
Status | New | ⇒ | Pending |
Labels |
Removed:
?
|
Category | ⇒ | Libraries |
Happy to test if there are instructions on how to do so :)
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3870.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-20 19:32:10 |
Closed_By | ⇒ | roland-d |
Hello @laoneo
Thank you for your contribution but due to lack of activity I am going to close this issue. Feel free to open it anytime when you want to follow up on it.
Updated the description of the patch. But can't open the pull request. Maybe someone of you guys can do it.
Text is: laoneo wants to merge 1 commit into joomla:staging
from unknown repository
The unknown repository
means that the patch behind this Pull don't exitsts anymore.
Thanks for the info. Cleaned up my old repo and now all PR's are gone. Anyway, opened a new one.
Please create a tracker on joomlacode and give test instructions