Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More places to support categories with sections #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion administrator/components/com_fields/models/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ protected function getListQuery()
if ($parts)
{
// Get the category
$cat = JCategories::getInstance(str_replace('com_', '', $parts[0]));
$cat = JCategories::getInstance(str_replace('com_', '', $parts[0]) . '.' . $parts[1]);

// If there is no category for the component and section, so check the component only
if (!$cat)
{
$cat = JCategories::getInstance(str_replace('com_', '', $parts[0]));
}

if ($cat)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@
$userId = $user->get('id');
$context = $this->escape($this->state->get('filter.context'));
$component = $this->state->get('filter.component');
$section = $this->state->get('filter.section');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.ordering');
$saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');

// The category object of the component
$category = JCategories::getInstance(str_replace('com_', '', $component));
$category = JCategories::getInstance(str_replace('com_', '', $component) . '.' . $section);

// If there is no category for the component and section, so check the component only
if (!$category)
{
$category = JCategories::getInstance(str_replace('com_', '', $component));
}

if ($saveOrder)
{
Expand Down