? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
17 Apr 2016

Pull Request for Issue #9846

This is a redo of #8698 , which there are typos.

Create an article set as Registered with a Read More.
Create a menu item of type category blog displaying the category of the article. Make sure Show Unauthorised Links is set to Yes.
Display the menu item in frontend and click on the Read More for that article.
Log in.

Before patch: the user is redirected to the user profile.
After patch: the article displays in full.
Test with Protostar and Beez3 (for which the ReadMore part was totally absent from default.php)

This is due to the changes in JUri::isInternal() since 3.4.6.

As no one has proposed a solution in that method, the only way to get this to work is to take off the JRoute for the return links.

IMPORTANT INFORMATION:
This will work for Core templates and 3rd party templates where there are no overrides for the com_content views concerned.
I suggest to PLT to make a specific announcement on this.

avatar infograf768 infograf768 - open - 17 Apr 2016
avatar infograf768 infograf768 - change - 17 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2016
Labels Added: ?
avatar richard67
richard67 - comment - 17 Apr 2016

@infograf768 Just tested Protostar and Beez3. After patch it was like this:

  • With Protostar all works as expected, i.e. I see the intro text only and the "Register to read more" button when not being logged in, and after login I see the full article text without the button. When I log out then I again see only the introtext plus the button.
  • With Beez3 I also see the button after having logged in, it appears between the intro text and the rest of the article. And when I log out, the full article text with button is still shown after log out.

Am not sure if this strange behavior with Beez3 is an issue, or if there is a mistake on my side, so I do not want to mark the test result as unsuccessful.

Can you check if you can reproduce my Beez3 test?


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

avatar brianteeman brianteeman - change - 18 Apr 2016
Category Authentication
avatar laoneo
laoneo - comment - 18 Apr 2016

If the site works in SEF mode, does it then not redirect to none SEF urls? Should it really be like that?

avatar infograf768
infograf768 - comment - 18 Apr 2016

@laoneo
Nope, if in SEF mode, it will redirect in SEF mode. Please test for yourself.

@richard67 You are correct. Please test again.

avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

When patch applied : Beez3 shows the complete article even when not logged in.

When patch applied : Protostar OK

When patch applied : Tested on 3rd party template (without com_content overrides) OK


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

avatar richard67
richard67 - comment - 18 Apr 2016

@infograf768 I can confirm @mikeveeckmans findings for the single article view with Beez3:

When being on the single article page, the full article (without button) is always shown, regardless if logged in or not.

In the category blog view, the display is correct in Beez3, i.e. intro text plus button if not logged in and complete article without button if logged in, with correct display change after login/logout.

With Protostar still all is correct.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Apr 2016

@richard67 @mikeveeckmans i think #9964 is exactly to solve that issue across templates.

avatar infograf768
infograf768 - comment - 18 Apr 2016

folks, beez3 needs more work than just the return issue when read more as quite a few changes were introduced in core without taking. care of beez.
i suggest to separate it from this patch. I can change the title if desired.

avatar richard67
richard67 - comment - 18 Apr 2016

@infograf768 I agree. Shall I wait for some further commit before testing again? Or just set my test result to success because it works with Protostar (and others not having any overrides) as it is now?

avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

@infograf768 same as @richard67 here ;-) i tested successful on protostar and 3rd party

avatar infograf768
infograf768 - comment - 18 Apr 2016

Please, @richard67 and @mikeveeckmans
Indeed, please set it to Success on https://issues.joomla.org/tracker/joomla-cms/9959

avatar mikeveeckmans mikeveeckmans - test_item - 18 Apr 2016 - Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on f254d58

When patch applied : Protostar OK

When patch applied : Tested on 3rd party template (without com_content overrides) OK


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

avatar richard67 richard67 - test_item - 18 Apr 2016 - Tested successfully
avatar richard67
richard67 - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on f254d58


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

avatar infograf768
infograf768 - comment - 18 Apr 2016

@richard67 and @mikeveeckmans

I will rtc this, but I may have found out something interesting for Beez3:
I just copied core default.php (after applying this PR) and overwrote in beez3 html/com_content/article/default.php with the core one and it seems it now works fine for a single article. Can you test?

avatar infograf768 infograf768 - change - 18 Apr 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 18 Apr 2016

RTC. Remains Beez3 to debug.


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

avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Labels Added: ?
avatar richard67
richard67 - comment - 18 Apr 2016

@infograf768 I guess you mean you copied components/com_content/views/article/tmpl/default.php (patched) to templates/beez3/html/com_content/article/, right?

avatar infograf768
infograf768 - comment - 18 Apr 2016

Yes, the one produced by this patch.

avatar richard67
richard67 - comment - 18 Apr 2016

@infograf768 Funny: It works with the copied file for beez3. When comparing the files (core file and beez3 override) before the patch, they look so different that the last thing what I would expect is that it works with the copied core file. But it does.

avatar infograf768
infograf768 - comment - 18 Apr 2016

then i think we can safely delete the beez override.
@wilsonge what do you think?

avatar smz
smz - comment - 18 Apr 2016

@infograf768
JM, if you look at the single article view (/components/com_content/views/article/view.html.php) at lines 70-71 you will find the following:

// TODO: Change based on shownoauth
$item->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));

Isn't this a sign that something was left behind there (and probably in other views) about the handling of readmore_link?

And shouldn't my considerations in #9964 (there are things that do not belongs to templates, but views) do apply to this case too?

avatar smz
smz - comment - 19 Apr 2016

@infograf768

I made some test and I found what I think is a slightly more elegant implementation of the solution you found:

You can put your corrected routing code in line 71 of /components/com_content/views/article/view.html.php:

$item->readmore_link = base64_encode(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));

then at the template level just use:

<?php $link->setVar('return', $this->item->readmore_link); ?>

I've tested with the "Single article" and it works

"category views" are another story, in the sense that the 'readmore_link' property is not set for article items handled by "category views"

I overcome this by inserting the same above line at line 94 of /components/com_content/views/category/view.html.php

This put the properties of articles generated by "single article" and "category" views in sync as far as regards this aspect.

Then we can use <?php $link->setVar('return', $this->item->readmore_link); ?> also for category views.

I've still to check what should be done for the other templates in which you inserted your code (very little, I guess, beside referencing $item->readmore_link...)


I think that the solution I described above is more similar to what was done before merging the PR that fixed the security issues related to the "return" parameter in the readmore link. Edit: no, I checked and readmore_link wasn't used even before that. Wondering when it was used and when felt in disgrace...

I also think that if we don't go this way the $item->readmore_link is orphan property, unused anywhere it is expected to be used.

As a last consideration, I'm wondering if this could not be the occasion for standardazinig on the usage of the joomla.content.readmore JLayout, which is used in "Category Blog" but not elswhere (and hence the visual difference for readmore links in various templates)

avatar infograf768
infograf768 - comment - 19 Apr 2016

@smz
My thought is that we are already enough not B/C with the JUri::isInternal() to now introduce such a change in the view.html.php

Also i looks like $item->readmore_link is a remnant of 2.5 where the value was used in default.php.
In any case, this PR just solves the bug. Its purpose is not to rewrite the functionnality. This, if judged necessary should be for another PR.

avatar rdeutz rdeutz - change - 19 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 19 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-19 08:11:51
Closed_By rdeutz
avatar rdeutz rdeutz - close - 19 Apr 2016
avatar rdeutz rdeutz - merge - 19 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 19 Apr 2016
avatar rdeutz rdeutz - reference | 4342168 - 19 Apr 16
avatar rdeutz rdeutz - merge - 19 Apr 2016
avatar rdeutz rdeutz - close - 19 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 19 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment