?
avatar FreeMindedMedia
FreeMindedMedia
6 Jul 2015

Steps to reproduce the issue

I enabled the system cache plugin, Global Configuration to Conservative Cache, and setup all my default joomla modules menus to 'No Cache' under Advanced tab. My issue is when i try to clicked the menu item from the frontend, they all take me to the incorrect page not where they're assigned to from the backed. But when I disable the cache all the menu items work fine.

The menu items when clicked from the frontend, are supposed to load the correct linked pages.

Expected result

Menu item 1 -> page1.html
Menu item 2 -> pag2.html

Actual result

Menu item 1 -> page2.html
Menu item 2 -> pag1.html

System Information:
Joomla! v3.3.6
PHP v5.6.9
MySQL Database v5.5.43-0+deb7u1
Web Server: Apache

Additional comments

avatar FreeMindedMedia FreeMindedMedia - open - 6 Jul 2015
avatar Fedik
Fedik - comment - 6 Jul 2015

try disable "system cache plugin" and try again :wink:
"system cache plugin" and "Global Configuration Conservative Cache" is independent things and must be used only one

avatar FreeMindedMedia
FreeMindedMedia - comment - 7 Jul 2015

Hi Fedik, I'm still having the same problem.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jul 2015

Confirm same Behaviour as FreeMindedMedia described. Settings: Global Cache "Conservative" on 15', all Menu-Modules set on "No Cache", "System Cache"-Plugin disabled.

Joomla 3.4.3, PHP 5.4.28, MySQLi 5.1.73-1, Web Server: Apache.

avatar jimhill10
jimhill10 - comment - 24 Jul 2015

I have the same thing happening on three different sites. Had to disable caching altogether. Not browser cache via plugin, but conservative cache via global conf.

avatar Fedik
Fedik - comment - 25 Jul 2015

I cannot reproduce such behavior,

which menu module do you use?
and do you use additional cache extensions?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Jul 2015

Not shure what you mean with "which menu module do you use?" Its Menue-Module, Behaviour indepentend of Template (tested Protostar and usual JSN-Boot).

avatar jimhill10
jimhill10 - comment - 25 Jul 2015

No other cache extension. Menu item is Category view. Conservative cache. No memcache in shlib.

On Jul 25, 2015, at 8:39 AM, Fedir Zinchuk notifications@github.com wrote:

I cannot reproduce such behavior,

which menu module do you use?
and do you you use additional cache extensions?


Reply to this email directly or view it on GitHub.

avatar brianteeman
brianteeman - comment - 25 Jul 2015

Does your web host do some caching? Do you use cloudflare or similar?

On 25 July 2015 at 14:01, jimhill10 notifications@github.com wrote:

No other cache extension. Menu item is Category view. Conservative cache.
No memcache in shlib.

On Jul 25, 2015, at 8:39 AM, Fedir Zinchuk notifications@github.com
wrote:

I cannot reproduce such behavior,

which menu module do you use?
and do you you use additional cache extensions?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#7354 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar jimhill10
jimhill10 - comment - 25 Jul 2015

No, this one is hosted at Rochen. But I have a site at Siteground using memcached and it does the exact same thing. I had to turn off caching for both.

Sending you admin access Brian. JMH

From: Brian Teeman [mailto:notifications@github.com]
Sent: Saturday, July 25, 2015 9:08 AM
To: joomla/joomla-cms joomla-cms@noreply.github.com
Cc: jimhill10 jimhill10@gmail.com
Subject: Re: [joomla-cms] When Joomla 3 cache is enabled, module menus load a wrong page when clicked (#7354)

Does your web host do some caching? Do you use cloudflare or similar?

On 25 July 2015 at 14:01, jimhill10 notifications@github.com wrote:

No other cache extension. Menu item is Category view. Conservative cache.
No memcache in shlib.

On Jul 25, 2015, at 8:39 AM, Fedir Zinchuk notifications@github.com
wrote:

I cannot reproduce such behavior,

which menu module do you use?
and do you you use additional cache extensions?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#7354 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/


Reply to this email directly or view it on GitHub #7354 (comment) .

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Jul 2015

Using MenuItemType "K2 » Latest items from (one or more) users or categories" shows that Cache-Problem, no other k2-MenuItemType. No Caching by Hoster or Cloudfare or similaer. Turning off "Global Cache" all works fine.

avatar jimhill10
jimhill10 - comment - 17 Aug 2015

This is still an ongoing issue. It happens both with K2 "retrieve items from category" and the base Joomla content category blog views in a menu item. Whenever the global cache is enabled (conservative cache) the menu items only show the first category of items. When another category is selected with the menu item the old category list remains showing. Turning off the cache in global config eliminate the issue. Anyone have ideas on this?

avatar tranduyhung
tranduyhung - comment - 21 Aug 2015

I couldn't reproduce this problem on local host or online sites hosted by SiteGround (SiteGround's jSGCache is not installed, only SiteGround's Static Cache used). Tested with Test sample data, Protostar template, my own template.

avatar jimhill10
jimhill10 - comment - 21 Aug 2015

I can give you access to a site if that would help. Cache is off on that site for now because it breaks like I said when it is on.

Jim Hill, jimhill10@gmail.com jimhill10@gmail.com

From: Duy Hung TRAN [mailto:notifications@github.com]
Sent: Friday, August 21, 2015 10:45 AM
To: joomla/joomla-cms joomla-cms@noreply.github.com
Cc: jimhill10 jimhill10@gmail.com
Subject: Re: [joomla-cms] When Joomla 3 cache is enabled, module menus load a wrong page when clicked (#7354)

I couldn't reproduce this problem on local host or online sites hosted by SiteGround (SiteGround's jSGCache is not installed, only SiteGround's Static Cache used). Tested with Test sample data, Protostar template, my own template.


Reply to this email directly or view it on GitHub #7354 (comment) . https://github.com/notifications/beacon/AD53LUQs2q4b3onrEvi7ViSpMtCGHnV9ks5opzD4gaJpZM4FSynz.gif

avatar jimhill10
jimhill10 - comment - 22 Aug 2015

On my site when conservative cache is on I experience the issue. Caching is set to off on the Menu module. Turn back off and the issue goes away. The issue followed me from my Siteground host to my VPS at Wiredtree. Had the same issue on the Siteground both with and without memcache. Did not see any speed advantages with SG static and dynamic cache so I never had those one (Jotcache takes up the slack). By the way, have this same issue on another Joomla site without Jotcache. First saw it way back in 3.1. Kind of a vexxing issue. I am cloning one site to dev to look more deeply into this.

avatar iandalkin
iandalkin - comment - 1 Jan 2016

Just wondering if anyone ever tracked this issue down. Problem persists .. conservative or progressive cache 'on' + K2 menu items 'show latest items from category' = non-functioning site.

avatar jimhill10
jimhill10 - comment - 1 Jan 2016

Nope, the issue still persists, has so since Joomla 3.0, and seems to have something to do with the template. On some of my sites the issue does not arise, but on several others I cannot utilize any of the caching. One of my sites using a Yootheme was broken out of the box.

avatar ggppdk
ggppdk - comment - 3 Jan 2016
  • It is the responsibility of the controller of every component to setup display() task parameter: $safeurlparams which is eventually passed to Joomla makeId() function for creating the cache id of a page !

Quoting / copying from Joomla cache.php file

* Create safe id for cached data from url parameters set by plugins and framework

Please notice the - SET BY PLUGINS -

About platform defaults see below

// Platform defaults
$defaulturlparams = array(
    'format' => 'WORD',
    'option' => 'WORD',
    'view'   => 'WORD',
    'layout' => 'WORD',
    'tpl'    => 'CMD',
    'id'     => 'INT'
);

As you can see the Itemid is not in the platform defaults,

About comment of @franz-wohlkoenig

Using MenuItemType "K2 » Latest items from (one or more) users or categories" shows that Cache-Problem, no other k2-MenuItemType

  • because Itemid is not in the safeurlparams (the component just uses defaults)
  • and because the userids (and the category ids) are via parameter that are not added to the URL and if it were added you would still need to add it to safeurlparams

because of the above after enabling cache , and visiting the 2 menu items, the 2 menu items will show the same page depening on which is visited first

com_content component does not suffer from this bug because it adds Itemid to the safeurlparams,
in its display() task of its default controller:

$safeurlparams = array(
    'catid' => 'INT',
    'id' => 'INT',
    'cid' => 'ARRAY',
    'year' => 'INT',
    'month' => 'INT',
    'limit' => 'UINT',
    'limitstart' => 'UINT',
    'showall' => 'INT',
    'return' => 'BASE64',
    'filter' => 'STRING',
    'filter_order' => 'CMD',
    'filter_order_Dir' => 'CMD',
    'filter-search' => 'STRING',
    'print' => 'BOOLEAN',
    'lang' => 'CMD',
    'Itemid' => 'INT');

One can argue and i would agree that Itemid should be in Joomla default safeurlparams, and i would vote for this change,

  • but in any case it is not a Joomla bug, just an "issue" with default behaviour that leaves the responsibility of adding it to the component

The change will only have a small effect on Joomla cache size in some cases, which should be small

  • considering filter-search is in safe URL parameters instead of setting the $cacheable display() task parameter to OFF, which does improve site speed by caching searches, but makes the cache include searches aka much larger, i think not adding ItemId to $defaulturlparams makes little sense ?
avatar ggppdk
ggppdk - comment - 3 Jan 2016

I forgot to say @jimhill10

  • contact developers of the component with this information,

asking them to set $safeurlparams in the display task, including Itemid and any other variables that may be needed, because Itemid is one of them

about Itemid again (sorry please don't be annoyed), despite this not being a joomla bug, since it is common case that menu item contains display settings, it would be best if Joomla defaults included it, but probably i am missing the reason why it was not included in the framework defaults, someone with better knowledge should say

The above information, i found myself , when i was fixing our component caching issues about 1 - 2 years ago

avatar jimhill10
jimhill10 - comment - 3 Jan 2016

Thanks for that!

avatar iandalkin
iandalkin - comment - 4 Jan 2016

Does anyone have an over-ride for this yet? I passed the information to K2 who says it's a Joomla issue. Tearing my hair out.

avatar ggppdk
ggppdk - comment - 4 Jan 2016

(regarding the "Latest items" view of K2)

I passed the information to K2 who says it's a Joomla issue.

Not all controllers are setting the $urlparams

e.g.
components/com_k2/controllers/itemlist.php
is indeed setting $urlparams

...
if (K2_JVERSION != '15')
{
    $urlparams['limit'] = 'UINT';
    $urlparams['limitstart'] = 'UINT';
    $urlparams['id'] = 'INT';
    $urlparams['tag'] = 'STRING';
    $urlparams['searchword'] = 'STRING';
    $urlparams['day'] = 'INT';
    $urlparams['year'] = 'INT';
    $urlparams['month'] = 'INT';
    $urlparams['print'] = 'INT';
    $urlparams['lang'] = 'CMD';
    $urlparams['Itemid'] = 'INT';
}
parent::display($cache, $urlparams);

but

  • neither components/com_k2/controllers/latest.php
  • nor its parent controller: components/com_k2/controllers/controller.php are setting $urlparams, .../latest.php only has:
...
parent::display($cache);

you can copy the IF statement into the .../latest.php file,

  • and replace parent::display($cache); with parent::display($cache, $urlparams);

and it should work (clear cache once after the change)

it is not a Joomla bug

avatar jimhill10
jimhill10 - comment - 5 Jan 2016

This is interesting because it also happens in plain Joomla 3.4 without K2.

avatar ggppdk
ggppdk - comment - 5 Jan 2016

@jimhill10
you are missing the point,

  • the fact that some/any Joomla controller of any component might be broken in a similar way,

does not mean that latest.php controller of K2 can get away with not setting all the needed URL parameters

EVERY controller needs to set proper $urlparams

  • latest.php controller of k2 is not setting any, neither its parent controller, thus it is using the platform defaults which do not include "Itemid" !
  • i hacked Joomla code and made a function stack printout and also printed the passed $urlparams, they are empty, as expected by looking at the code, thus the platform defaults which do not include "Itemid" were used ! I also confirmed the fix too

Let's not guess, and confirm that every INDIVIDUAL CONTROLLER is setting these properly,

  • if some view of Joomla is broken in a similar way it should be fixed too BUT this is no related

  • my component caching was broken in a similar way 2 years ago i took time to fix it, i found no Joomla caching bug !! other than the requirement that every component needing to set the safeurlparams properly (and the $cacheable FLAG), which is not a bug but a requirement

  • before any developer claims a Joomla bug he/she needs to do some proper testing, if he does not have time (which is normal), like i do NOT have time, he can postpone claiming a bug, until he has time to test properly, and also point out exactly why it is a Joomla bug

because of having fixed my component for similar bug, it only took me 20 minutes to test, but i will not spend any more time to test anything else, regardless if i am right or wrong

avatar jimhill10
jimhill10 - comment - 5 Jan 2016

Thanks, will dig into this today. Appreciate all your help!

avatar iandalkin
iandalkin - comment - 6 Jan 2016

For anyone working with K2 and experiencing this issue, I have just installed this plugin and, touch wood, so far it seems to have fixed the issue! Go figure: https://dj-extensions.com/downloads/cat_view/194-k2-fix-plugin https://dj-extensions.com/downloads/cat_view/194-k2-fix-plugin


Ian Dalkin
http://www.siterescue.com.au
101 Wentworth Street
Blackheath 2785
NSW Australia
Ph: +61 2-47877533 0434-575470

avatar brianteeman brianteeman - change - 10 May 2016
Priority Urgent Medium
Status New Confirmed
avatar brianteeman
brianteeman - comment - 26 Aug 2016

Closed


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7354.

avatar brianteeman brianteeman - change - 26 Aug 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-08-26 12:42:13
Closed_By brianteeman
avatar brianteeman brianteeman - close - 26 Aug 2016

Add a Comment

Login with GitHub to post a comment