Language Change PR-staging

Success

Related to # 6997

User tests: Successful: Unsuccessful:

avatar hans2103
hans2103
10 Oct 2015

closed #6997 in favor of this one. Started all over again.

problem: Joomla! makes no difference in devices when caching a page.
This pull request makes an end to it and adds a prefix to the cache ID.
This pull request uses the Joomla! default browser detection implementation.

To test this PR you have to create a template override with platform specific code in it. For example an override on com_content article.
Example code:

        jimport('joomla.application.web.client');
        $webclient = new JApplicationWebClient();

        if ($webclient->mobile)
        {
            echo 'Joomla! rocks';
        }

On mobile you will see the text "Joomla! rocks"
The same page on desktop or tablet you will not see the text "Joomla! rocks".

before this patch && caching enabled:

  • The first platform (mobile or desktop) will initiate the cache.
  • When the other platform asks for this page it will get the cached page for the other platform. (desktop will get mobile and vice versa)

after this patch && caching enabled:

  • enable the parameter "Platform specific caching" in the Joomla! configuration
  • Both platforms are cached on visit by that platform.
  • When the other platform asks for this page it will get the cached page for that platform. (desktop gets cached version of desktop)

With this PR you can create platform specific pages AND use cache. (dance)
Special thanks to @roland-d for helping me with this pr

avatar hans2103 hans2103 - open - 10 Oct 2015
avatar hans2103 hans2103 - change - 10 Oct 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Oct 2015
Labels Added: Language Change PR-staging
avatar roland-d roland-d - change - 10 Oct 2015
Rel_Number 0 6997
Relation Type Related to
avatar n9iels n9iels - test_item - 10 Oct 2015 - Tested successfully
avatar n9iels
n9iels - comment - 10 Oct 2015

I have tested this item :white_check_mark: successfully on 8c1c750

After enabled the parameter "Platform specific caching" in the Joomla! configuration, the patch works fine for me. Please add this step to the test instructions :)


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

avatar hans2103
hans2103 - comment - 10 Oct 2015

@n9iels added "enable the parameter "Platform specific caching" in the Joomla! configuration" to the test instructions. Thx

avatar zero-24 zero-24 - change - 10 Oct 2015
Milestone Added: Joomla! 3.5.0
avatar zero-24 zero-24 - change - 10 Oct 2015
Category Cache Libraries
avatar zero-24 zero-24 - change - 10 Oct 2015
Easy No Yes
avatar joomla-cms-bot
joomla-cms-bot - comment - 11 Oct 2015

This PR has received new commits.

CC: @n9iels


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

avatar pe7er
pe7er - comment - 11 Oct 2015

@test successful

In Global Configuration I've enabled Conservative Cache.
I've created a template override /templates/protostar/html/com_content/article/default.php with the following code:

<?php 
jimport('joomla.application.web.client');
$webclient = new JApplicationWebClient();
if ($webclient->mobile)
{
    echo 'Joomla! mobile rocks';
}else{
    echo 'Joomla! desktop rocks';
}
?>

After applying the patch the same issue occurred: if I first visit the page with mobile phone, then the desktop will also see "Joomla! mobile rocks". After setting "Platform specific caching" to "Yes" and emptying Joomla's cache, the desktop showed 'Joomla! desktop rocks' and the mobile displayed 'Joomla! mobile rocks'.

Not that I had to use Google Chrome Inspector > Inspect Element > click on the mobile phone & select a device to properly display 'Joomla! mobile rocks'. Just re-sizing the browser to mobile phone size did not work.

avatar zero-24 zero-24 - alter_testresult - 11 Oct 2015 - pe7er: Tested successfully
avatar pe7er pe7er - test_item - 12 Oct 2015 - Tested successfully
avatar pe7er
pe7er - comment - 12 Oct 2015

I have tested this item :white_check_mark: successfully on 556c98a

I've tested this PR successfully but because I used github, the system does not see it as tested.
Therefore I've resubmitted my successful test report http://issues.joomla.org/tracker/joomla-cms/8055#event-104374 via issues.joomla.org


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

avatar RemcoJanssen RemcoJanssen - test_item - 12 Oct 2015 - Tested successfully
avatar RemcoJanssen
RemcoJanssen - comment - 12 Oct 2015

I have tested this item :white_check_mark: successfully on 556c98a

Worked perfectly


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

avatar zero-24 zero-24 - change - 12 Oct 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 12 Oct 2015

RTC for 3.5 thanks


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

avatar joomla-cms-bot joomla-cms-bot - change - 12 Oct 2015
Labels Added: RTC
avatar roland-d roland-d - change - 17 Oct 2015
Milestone Added:
avatar roland-d roland-d - change - 17 Oct 2015
Milestone Removed: Joomla! 3.5.0
avatar rdeutz rdeutz - change - 17 Oct 2015
Milestone Added: Joomla! 3.5.0
avatar rdeutz rdeutz - change - 17 Oct 2015
Milestone Removed:
avatar roland-d roland-d - close - 17 Oct 2015
avatar roland-d
roland-d - comment - 17 Oct 2015

Thanks all. @rdeutz merged this into 3.5-dev with commit aea70b2

avatar roland-d roland-d - change - 17 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-17 11:37:26
Closed_By roland-d
avatar wilsonge wilsonge - change - 17 Jan 2016
Labels Removed: RTC
avatar fevangelou
fevangelou - comment - 9 Apr 2016

a) Has this been tested with the (system) page cache plugin?

b) If the browser detection is being done with PHP (which I assume it is, since you can the J API), you understand that this will have no effect when used with a reverse caching proxy like Varnish, right? Or any caching in front of Joomla, e.g. Nginx's FastCGI caching for PHP5-FPM.

avatar roland-d
roland-d - comment - 13 Apr 2016

@fevangelou A little late ;)

I don't remember if this has been tested with the page cache plugin.

If it has no effect than at least it works as it used to work before, feel free to post a pull request that deals with those cases as well. By default this option is turned off.

Add a Comment

Login with GitHub to post a comment