Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single registered article guest view #9865

Merged
merged 5 commits into from Apr 15, 2016
Merged

Single registered article guest view #9865

merged 5 commits into from Apr 15, 2016

Conversation

brianteeman
Copy link
Contributor

Pull Request for Issue #9830

Testing Instructions

Create a single article with an intro and full image and a readmore
Set the article to registered only
Create a menu link to the article of type single article
In the menu options make sure show unauthorised links is set to show

Now check the menu item on the front end - you should see the introtext but not the intro image and when you login you see all the text and the full image

Apply the patch
Now check the menu item on the front end - you should see the introtext and the intro image and when you login you see all the text and the full image

@Webdongle
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 030de77

With Show Voting set to 'Show' ... the voting dropdown box displays twice to guests


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

@@ -133,7 +133,14 @@
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
<?php echo $this->item->introtext; ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move down below the "if"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, sorry, I was wrong on this: I mistook the if below as the if on "image_intro", but that's already in the JLayout

@smz
Copy link
Contributor

smz commented Apr 12, 2016

proposed some changes
sorry for the brevity (on the road...)

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @Webdongle


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

@brianteeman
Copy link
Contributor Author

Updated to remove double votes

@rgmears
Copy link

rgmears commented Apr 12, 2016

Works for me.


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

@woluweb
Copy link

woluweb commented Apr 13, 2016

I have tested this item ✅ successfully on dc144b3

Tested successfully on cc44ae1


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

@wojsmol
Copy link
Contributor

wojsmol commented Apr 13, 2016

@rgmears Please mark test result on https://issues.joomla.org/tracker/joomla-cms/9865

@rgmears
Copy link

rgmears commented Apr 14, 2016

@wojsmol

Please mark test result on ....

I don't know how to do that. Sorry.


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

@wojsmol
Copy link
Contributor

wojsmol commented Apr 14, 2016

@brianteeman
Copy link
Contributor Author

@rgmears @wojsmol its ok I manually added his test :)


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

@smz
Copy link
Contributor

smz commented Apr 14, 2016

I cannot test now (on a train with no test environ with me) but by simple code review it is evident that lines 137-140 are a duplicate of line 87.

Both echoes the content generated by "afterDisplayTitle" plugins (probably a very seldom used event, but anyway...) which in case will be duplicated...

In Joomla events list (https://docs.joomla.org/Plugin/Events/Content) I don't find "afterDisplayTitle": is it the same as "onContentAfterTitle"?

@smz
Copy link
Contributor

smz commented Apr 14, 2016

In https://docs.joomla.org/Plugin/Events/Content a note in the "onContentAfterTitle" event description says that

... this event has special purpose in com_content for use in handling the introtext.

but I'm unsure of what this is or could be as no further specification is given.

What is evident from code is that content generated by this event is displayed only if the "show_intro" param is set Edit: set to "Hide".

@smz
Copy link
Contributor

smz commented Apr 14, 2016

Confirmed by testing:

Without:

without

With:

with

The "Test Aftertitle" plugin is:

<?php
defined('_JEXEC') or die;

class PlgContentTest_aftertitle extends JPlugin {

    // onContentAfterTitle handler
    public function onContentAfterTitle($context, &$article, &$params, $limitstart) {
        return '<h3>This is generated by the "Test Aftertitle" plugin</h3>';
    }

}

@smz
Copy link
Contributor

smz commented Apr 15, 2016

I have tested this item 🔴 unsuccessfully on dc144b3

See above...


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

smz and others added 2 commits April 15, 2016 02:56
This solves the duplication of the output for the "onContentAfterTitle" event and also solves the issues that the "onContentPrepare" event is not handled for the intro text.

I'm unsure, anyway, if it is correct to fix the latter here or if it would be better to fix it at the "view" level (_so that all templates, even overridden ones_) could benefit of the fix
@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @rgmears, @smz, @Webdongle, @woluweb


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

@Webdongle
Copy link
Contributor

As the patch has been updated because of the fail when tested with the edited plugin ... should the Testing Instructions be updated to take into account that part of the test ?

In https://docs.joomla.org/Plugin/Events/Content a note in the "onContentAfterTitle" event description says that

... this event has special purpose in com_content for use in handling the introtext.

Has me totally confused and am unsure how to perform the test with the edited plugin ?


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

@smz
Copy link
Contributor

smz commented Apr 15, 2016

@Webdongle
TBH, I'm as much confused as you are, and probably quite more (but I'll elaborate about that later on)

As far as regards testing instructions the last word is of course @brianteeman's one, but I can explain what I did in the PR I proposed to Brian and he later incorporated, if this can help.

  1. I eliminated the duplicate display of output generated for the "onContentAfterTitle". This wasn't there at the beginning and was introduced (by mistake, IMHO) in Brian's PR. Eliminating this, thus, doesn't change the expected behaviour and hence testing instructions.

  2. I added an extra processing step so that the intro text is passed to the "onContentPrepare" handler. This fixes the issue of directives like {loadposition} or {loadmodule} appearing verbatim in the generated output instead of being processed. I added this as I interpreted this was Brian wish when (while closing Intro image not showing when not logged in #9830) he said:

... better code than suggested before as it uses the layout correctly and the plugins (i hope) (my emphasis )

This second change requires of course also testing that those directives are indeed honoured (as they are, from my testing).

About this second change I'm also unsure (and I expressed my doubts directly to Brian) if it is correct to do that here or it would be better to perform that at an higher level (at the view level, probably) so that not only this template, but also all other templates using the "intro text" would benefit of the fix.


Unsure if off topic (about the "onContentAfterTitle" event and the "Show Intro Text" option).

The "Show intro text" option seems to be quite a strange beast. The description is:

If set to Show, the Intro Text of the article will show when you drill down to the article. If set to Hide, only the part of the article after the "Read More" break will show.

It indeed does that (intro text not displayed in the "Single Article" view if set to "Hide") but it also controls (with inverted logic) weather the content generated by the "onContentAfterTitle" should be displayed or not.

This is applied, apparently in an inconsistent way, throughout different views. For this, I think we'll need the memory of "old timers" to explain why this is done this way and what's the logic behind it (I'm calling @infograf768 for that, as apparently he did put his hands on that and probably should know...)

@conconnl
Copy link
Member

I have tested this item ✅ successfully on bc7d64c

Tested successful per instructions


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

@Simonkloostra
Copy link

I have tested this item ✅ successfully on bc7d64c

Testscenario executed successfully, intro-image is now shown in single-article view


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

@rgmears
Copy link

rgmears commented Apr 15, 2016

I have tested this item ✅ successfully.

Intro Image shows.

{loadposition} and {loadmodule} both display content not code.

@joris85
Copy link

joris85 commented Apr 15, 2016

Tested successfully,
As quest you do not see the intro image while you should see the intro image.


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

@klatte88
Copy link

Patch tested succesfully after patch intro image shows up as expected


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

@klatte88
Copy link

I have tested this item ✅ successfully on bc7d64c

problem as described recreated and solved after patch


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

@brianteeman
Copy link
Contributor Author

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 15, 2016
@brianteeman brianteeman added this to the Joomla 3.5.2 milestone Apr 15, 2016
@rgmears
Copy link

rgmears commented Apr 15, 2016

Forgive the uninformed question, but, what does RTC mean?

@smz
Copy link
Contributor

smz commented Apr 15, 2016

@rgmears

Forgive the uninformed question, but, what does RTC mean?

Ready To Commit

@brianteeman
So you think it is OK to fix the "onContentPrepare" issue here?

@rdeutz rdeutz merged commit 140ecb3 into joomla:staging Apr 15, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 15, 2016
@rgmears
Copy link

rgmears commented Apr 15, 2016

Thanks @smz .

@brianteeman
Copy link
Contributor Author

Create a new issue please

On 15 April 2016 at 15:04, Sergio Manzi notifications@github.com wrote:

@rgmears https://github.com/rgmears

Forgive the uninformed question, but, what does RTC mean?

_R_eady _T_o _C_ommit

@brianteeman https://github.com/brianteeman
So you think it is OK to fix the "onContentPrepare" issue here?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9865 (comment)

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

@smz
Copy link
Contributor

smz commented Apr 15, 2016

about what?

smz added a commit to smz/joomla-cms that referenced this pull request Apr 17, 2016
This was hackish as it would had fixed things only for this template.
Not needed anymore now that the problem is fixed in the view.
@smz
Copy link
Contributor

smz commented Apr 17, 2016

... pinging all who were involved in this as I amended it in #9964: thanks for testing and/or review.

@rdeutz rdeutz modified the milestones: Joomla 3.5.2, Joomla! 3.6.0 May 1, 2016
@brianteeman brianteeman deleted the registered-intro branch May 9, 2016 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet