eworkers / K2ForJ4

GNU General Public License v2.0
11 stars 6 forks source link

404. Pagination in K2ForJ4 tags doesn't work. #46

Closed cmirnow closed 8 months ago

cmirnow commented 8 months ago

You can see the issue here if you do a click on the #joomla tag at the bottom of the K2ForJ4 article. After navigating to the tag page, try using pagination.

eworkers commented 8 months ago

can you please share your seo config? We can see a weird 1 after /tag https://masterpro.ws/component/k2/itemlist/tag/1/joomla?Itemid=102&start=10 link should be like this: https://masterpro.ws/component/k2/itemlist/tag/joomla?Itemid=102&start=10 we need to figure out where does this extra /1 comes from. Did you download the last version and installed it? or did you modify the code yourself?

cmirnow commented 8 months ago

Yeah. I noticed that, too. It's weird for me too. Seo configuration is very simple.

If it helps, I can make two copies of my blog: Joomla 3 (before the upgrade) and Joomla 4 (after the upgrade). And I'll give you full access.

NB. I used the latest version of K2ForJ4. And I didn't make any changes in the code. Also, I never used seo extensions on this site.

seo

cmirnow commented 8 months ago

I need to clarify something.

On 02.01.2024 I did an upgrade of this blog from Joomla 3 to Joomla 4 . I was using the latest version of K2ForJ4 at the time. I saw the problem and reported it to you. I saved the upgraded site using Akeeba backup, reverted the old version of the site (Joomla 3) and waited for you to fix the bug. Immediately after that fix, I downloaded the new K2ForJ4, deployed the previously updated site (Joomla 4) and installed the new version of K2ForJ4. Yesterday I updated K2ForJ4 again with the new version from your github.

Perhaps all this is relevant to analyze the problem.

eworkers commented 8 months ago

I meant the SEO settings for k2, the one you can find within the SEO tab inside the settings (from k2 component, the settings button within the toolbar). It can be useful to save your settings for k2 as well, maybe some param was missed during the process.

cmirnow commented 8 months ago

Saving the settings and clearing the cache did not yield any results. Please forgive me that the screenshots of the admin panel are not in English. Joomla does not have the flexibility of linux to change the language console.

seo1

seo2

eworkers commented 8 months ago

We can't reproduce. Just a hunch, can you try to test using Joomla default template (Cassiopeia) and report back. (if you are using an override template, also try not use it while testing)

cmirnow commented 8 months ago

OK. I switched the template to Cassiopeia. The overrides were not used. The problem remained.

seo3

eworkers commented 8 months ago

Did you try to disable 3rd party plugins one by one and test? We tried to reproduce but no luck so far. Also please share your env info, including Joomla and PHP exact versions

cmirnow commented 8 months ago

Yes, I have tried disabling 3rd party plugins. That doesn't solve the problem. I have very few such plugins.

@eworkers, please remove this information from my comment:

cmirnow commented 8 months ago

tried to reproduce but no luck so far.

If it helps, I can make two copies of my blog: Joomla 3 (before the upgrade) and Joomla 4 (after the upgrade). And I'll give you full access.

eworkers commented 8 months ago

I don't think a backend access would, do you mind sharing the source code for your website without the database and media file? If that is ok with you, please make sure to include only the source code excluding configuration.php, also exclude image folder and other media folders like media/k2/images, Please make sure to include the .htaccess (some zipping software skips the .htaccess) Let me know so i can share an email with you where you can privately provide us with the source.

cmirnow commented 8 months ago

Ok.

cmirnow commented 8 months ago

How can I transfer the archive to you?

eworkers commented 8 months ago

How can I transfer the archive to you?

no need anymore, we were able to reproduce

eworkers commented 8 months ago

we will make a deep revision for router under J4, while we are revisioning , here is a temp fix for your problem: inside /components/com_k2/router.php within K2CustomSefBuildRoute function after:

        if ($mView == @$query['view'] && $mTask == @$query['task'] && $mTag == @$query['tag'] && isset($query['tag'])) {
            unset($query['view']);
            unset($query['task']);
            unset($query['tag']);
        }

insert the following:


        if (isset($query['tag']) && $query['task'] == 'tag') {
            unset($query['id']);
        }

do the same for K2BuildRoute if you plan to use default routing instead of k2 custom routing.

cmirnow commented 8 months ago

Thank you. It's working. But only if I fix both functions. Fixing only K2CustomSefBuildRoute function does not solve the problem.

eworkers commented 8 months ago

either K2CustomSefBuildRoute or K2BuildRoute is executed, this mean that you are using default routing and k2 custom sef is disabled. we will take a deep look at router and hopefully we can mitigate all issued problems for good.

eworkers commented 8 months ago

we will take a deep look at router and hopefully we can mitigate all issued problems for good.

I'll ask those questions here. Because they're not bugs, they're questions.

  1. Is it possible to update from Joomla 4 with K2ForJ4 to Joomla 5?
  2. After upgrading from Joomla 3 to Joomla 4 - com_k2_extended cache size increases two or three times in standard caching. What do you think about this, is this a consequence of the problem or is it ok?
  3. If an official version of K2 for Joomla 4 is published, will it be possible to upgrade from K2ForJ4 to K2?

Kindly move this to discussion section (someone created The future of K2forJ4 and it seems suitable for these questions of yours). We will answer all of the questions out there once we finish tackling some major issues.