1 year ago
3
Topic

Hello everybody!

I need to replay simple Joomla! structure - https://site.ru/category/alias

So, I make a Search in categories and show list of categories on the Main page. The next step - each Category opens as Category Content. OK, the next - I show a list of Articles of this category in Search module. I set router for article as "parent/alias" in this Search. Links for these articles are correct  - https://site.ru/category/alias. But the page doesn't exists and shows 404 error

The question is - what next? 

Get a Book for SEBLOD
1 year ago
0
Level 1

Hi again. 

So, I disassembled router for spareparts and found a little mistake (or feature) which I can't explain. 

File storage_location/joomla_article/joomla_article.php, method parseRoute, string 907:

$join .= ' LEFT JOIN #__cck_core AS e on e.' . $config['join_key'] . ' = a.id';

After this code result query looks like:
SELECT a.id FROM #__content AS a LEFT JOIN #__categories AS b on b.id = a.catid LEFT JOIN #__cck_core AS e on e.pk = a.id WHERE a.alias = 'art_alias' AND b.alias = 'cat_alias' AND e.cck = "category"

But in our case cck name is from $params which we took from Menu Item properties. As we remember Menu Item is List of Categories and cck name is also for category in this Menu Item settings. So, as I see we should join #__cck_core table not to #__content but to #__categories table. And result query should be like this:

SELECT a.id FROM #__content AS a LEFT JOIN #__categories AS b on b.id = a.catid LEFT JOIN #__cck_core AS e on e.pk = b.id WHERE a.alias = 'art_alias' AND b.alias = 'cat_alias' AND e.cck = "category"

I've changed ... on e.pk = a.id ... to ... on e.pk = b.id ...

So, as result I corrected string 907 in storage_location/joomla_article/joomla_article.php from
$join .= ' LEFT JOIN #__cck_core AS e on e.' . $config['join_key'] . ' = a.id';
to
$join .= ' LEFT JOIN #__cck_core AS e on e.' . $config['join_key'] . ' = b.id';

Now I can build my structure from start topic.

1 year ago
1
Level 1

Pull request created. See here.

4 months ago
0
Level 2

I've repeated my pull request for v.4 branch  -it is also not correct.

Get a Book for SEBLOD